简体   繁体   中英

Aurelia js add npm package

I want to use the following npm package https://www.npmjs.com/package/poker-evaluator It can also be found on github: github.com/chenosaurus/poker-evaluator

On the project folder I ran the following command line, npm install poker-evaluator --save

And it seems that I installed the library -> Package Json

I want to be able to run the functions from this module(poker-evaluator) and I can't insert this module.

tried multiple times and in different ways ...

Unfortunately, the package you are looking at relies on NodeJS APIs, so it cannot be used in the browser. If you look at its source, you'll see: https://github.com/chenosaurus/poker-evaluator/blob/master/lib/PokerEvaluator.js#L1

var fs = require("fs");
var path = require("path");

These are Node APIs that work with files. You'll have to use this package on your server and wrap it with an API that your Aurelia application will talk to.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM