-
Notifications
You must be signed in to change notification settings - Fork 981
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
npm / CommonJS compat #19
Comments
I'm confused. Does SJCL not work with Node or CommonJS servlets? Or are you requesting some kind of packaging? |
Sorry, I opened the issue too fast. A package.json would be great, publishing to npm even better. I scanned through the source, couldn't find any objects being exported for use on the server side like so: var sjcl = require('sjcl');
sjcl.hash.sha1 // etc. |
exports.sjcl = function sjcl { then when you run require, you should do |
@bitwiseshiftleft all you have to do is add the following code to ensure CommonJS compatibility for SJCL (thus to be able to have it running on Node.js out of the box): if (module && module.exports) {
module.exports = sjcl;
} |
Sorry to be so slow in responding to this. These lines are already in master and ecc; I'm not sure they belong in version-0.8, though, which should really be more stable by now. |
Hi. Added a package.json file in the following pull request: Installing it locally worked fine. Now someone just need to publish it in the npm registry: On a side note, I also added entropy collection for node.js in the following pull request: Looking forward to your feedback. Thanks! |
Adding something is still better than adding nothing. Also does this module support mobile devices yet? |
@tanx I suggest you repackage this in it's own repo and publish to npm yourself. perhaps it's obvious that whoever put this in github is not paying attention (or cares about node) I would also advertise in the node mailing list :) |
Yeah, sorry, I don't know anything about node, don't have a node install, and don't spend a ton of time maintaining SJCL, so it gets into a backlog. So, what exactly are you asking me to do? Install node, then adduser and publish? And that's all I have to do, and then node will work forever, or are there more steps? Thanks, On Apr 27, 2013, at 7:12 AM, Nuno Job notifications@github.com wrote:
|
No problem. Yeah it actually is that easy. When ever you make a change to the gihtub repo, you may also want to bump the version in the package.json file so the npm registry will see the updates. The upside is that it will make the project more visible to the node community and perhaps increase traction a bit. |
If you don't want to maintain the node version by yourself, you can add npm On Sun, Apr 28, 2013 at 2:48 AM, Tankred Hase notifications@github.comwrote:
|
@bitwiseshiftleft if you would like some help maintaining this repo (especially the node.js stuff), I would be glad to help out. We are using sjcl in a production environment in node at our company, so its definitely in our interest to invest some time. Handling all the pull requests yourself doesn't scale too well if you don't have a lot of time, and I don't think it's in the interest of your project to be forked for node.js. What do you think? Thanks |
For those of you looking for a crypto lib, that has good node.js and browser support. I can suggest forge. It's a complete TLS implementation in js with great RSA support and various hashing methods. It even supports RSA key generation in web worker threads. The AES bits seem to be forked from sjcl. |
I wrote a high level crypto lib on top of forge that works on node.js and the browser go ahead and check it out: |
Adding a +1 to publishing this to npm. This is a pretty easy thing to do if you already have node installed. Here is the relevant documentation: |
There is an open PR for this: |
Here you are guys: |
It's not working for me. Can't get browserify to play nice with sjcl for the life of me. Can someone point me to a minified / browserified version of sjcl that contains a proper commonJS wrapper, please? |
sjcl doesn't seem ready to be used in a rails asset pipeline. I was able to get it to precompile finally, but I'm getting sjcl not defined when I try to use it in prod... |
hmmmmm, I got it working in prod, but I'm not sure how exactly. I did 'npm i sjcl', then precompiled and it succeeded. Then I REMOVED node_modules/sjcl and it's now seemingly grabbing the sjcl.js version I have from public/assets/ and loading it ok. Still shaky but barely working... |
Would be great :D
The text was updated successfully, but these errors were encountered: