Git Product home page Git Product logo

Comments (14)

zoloft avatar zoloft commented on August 16, 2024

Makes sense publishing this on bower but why on npm? This package is not intended nor designed for node (and moreover node has access to openssl so there is really no need for a package like this)

from jsencrypt.

aaronshaf avatar aaronshaf commented on August 16, 2024

Some people use npm + browserify for front-end development. Also, if you don't do it, someone else will.

from jsencrypt.

zoloft avatar zoloft commented on August 16, 2024

Well, I think that the bower publication can be made immediately (of course @travist should do this), for npm I'd like to check that everything works fine when included using npm (+ browserify as you suggest) before publishing there.

from jsencrypt.

aaronshaf avatar aaronshaf commented on August 16, 2024

I strongly suggest using the UMD wrapper to cover all your AMD / CommonJS / global bases:

https://github.com/umdjs/umd

from jsencrypt.

travist avatar travist commented on August 16, 2024

I have also been wanting to add Grunt tools instead of a make file, so I do have plans to work on this (at least for npm with a package.json), but I just have not had a chance to get the changes in place. If anyone is willing to submit a pull request with this, I would be very grateful and then will gladly push it up to my NPM account.

from jsencrypt.

xpepermint avatar xpepermint commented on August 16, 2024

+1 for npm, no modules like this available but we need them. Running command-line commands in NodeJS is not what I would recommend. When using the openssl command you you have to do it in 2 steps where a private key must be saved into a file. Well... this is not strait forward when you have a nodejs cluster. I hope this project will go on, I really like it.

from jsencrypt.

zoloft avatar zoloft commented on August 16, 2024

Of course running openssl from inside nodejs would not be ideal but other modules (like the nodejs builtin crypto module) would do a better job without any doubt. The fact is that this implementation is meant for browser, not for server where the computational power would not be used as it should. Anyway if you feel that an API similar to this could be useful we could develop a specific branch for node JS compatibility keeping the public API untouched while using the crypto module underneath

from jsencrypt.

Klowner avatar Klowner commented on August 16, 2024

Quite a few people use node and npm for their front-end build process, libraries such as Browserify expose node modules to the client and having libraries available through npm really streamlines this process. While it's absolutely true that developers likely wouldn't benefit from using a library such as this one on the server side, it makes dependency management a breeze.

from jsencrypt.

aaronshaf avatar aaronshaf commented on August 16, 2024

When I first created this issue on Dec 2, 2013, I was mainly using Bower. Now, most of my colleagues and I have abandoned bower for npm & Browserify.

from jsencrypt.

zoloft avatar zoloft commented on August 16, 2024

Well for me is okay and I could publish it on npm, but I'm out of time sadly due to work. Before I publish it can anybody test that everything works well when included through browserify? Again sorry if I didn't on my own but has been a very busy summer and seems is not going to end yet :S

from jsencrypt.

travist avatar travist commented on August 16, 2024

Ok, just pushed it up to NPM. https://www.npmjs.org/package/jsencrypt

Let me know if this works or if we need to modify it.

from jsencrypt.

saschagehlich avatar saschagehlich commented on August 16, 2024

@travist There are a couple of things that need to be changed to make it work with node.

  • You need to add the main attribute to your package.json:
{
  // ...
  "main": "bin/jsencrypt.js"
}
  • You're accessing the navigator object in JSEncrypt which does not exist in node. You'll need to check whether the object is available. If not, treat it like it's a Chrome browser (both Node.js and Chrome use the V8 engine)

from jsencrypt.

timoshisa avatar timoshisa commented on August 16, 2024

+1 for comment by @saschagehlich on main attribute

from jsencrypt.

simkessy avatar simkessy commented on August 16, 2024

Yea can this change be made? It was recommended a few months ago and I've spent some time trying to figure out why it wasn't working.

from jsencrypt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.