-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node.js support #16
Comments
Thanks for finding those bugs! What you suggest would be useful, but while we would certainly welcome a node.js package, we could not commit to maintaining it. Mike |
You are welcome and thank you for your fast response! It seems to me that there isn't much to do to support Node.js. I am not sure how it will be for npm platform (I didn't it before), but for this repository to support Node.js there is not much to do (as I know in this moment of writing this). I did the following:
if (typeof module !== "undefined" && typeof module.exports !== "undefined") {
module.exports = {
FP: FP
};
}
Afterm them I used in my React project `npm install ' and was able to use the node package with your Javascript code with const CTX = require("pesto-client").CTX;
let ctxBls12461 = new CTX('BLS12461'); As of my understanding and testing it should be possible with these changes that the code is usable in Javascript as before and it is possible in another Javascript files as functions from a library in plain Javascript. Additionally a person is able to build a npm package locally and can use it in Node.js or React projects (I don't know much about AngularJS, but maybe also there - I didn't tested it yet). |
If you put together a Pull Request, and if it doesn't break anything, we will approve it. Unfortunately we don't have a JS expert on the team at the moment, so I cannot be of much help. Mike |
Ok. Let me do some tests and if everything works fine I can do a Pull Request and you or some of the contributors can double check it, such that there exist no side effects, which maybe I am not aware of. Thank you! I will let you know, when I am done with the tests. Pascal |
OK that's fine |
Pull Request + Merge done. |
Hello,
I wanted to use the Javascript part of the library for my project in React and did some exports of the function to bundle them into a Node.js package, including index.js and package.json, to import them into my React project as a Node.js package. Is there any chance that this could be useful in this repository or is there any planing for a Node.js package for this library which will be maintained?
I saw a version of the old library in npm, but this isn't maintained anymore.
In the time were I added the exports, I found some minor bugs.
Minor Bugs:
In the file fp2.js in row 137: should be
ctx.FP.BIG_ENDIAN_SIGN
instead ofFP.BIG_ENDIAN_SIGN
.In the file fp.js in row 32: should be
x instanceof ctx.BIG
instead ofx instanceof BIG
.I don't know why Javascript don't say anything about it, but Node.js told me that the
ctx
part is necessary.Thank you in advance!
The text was updated successfully, but these errors were encountered: