Alexandru_Morarasu
Alexandru_Morarasu

Reputation: 11

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 ...

Upvotes: 0

Views: 151

Answers (1)

Ashley Grant
Ashley Grant

Reputation: 10887

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.

Upvotes: 1

Related Questions