GithubHelp home page GithubHelp logo

Publish it to npm about zxcvbn HOT 6 CLOSED

dropbox avatar dropbox commented on August 23, 2024
Publish it to npm

from zxcvbn.

Comments (6)

binarykitchen avatar binarykitchen commented on August 23, 2024

I couldn't wait any longer and npm-published a fork
https://github.com/binarykitchen/zxcvbn-npm

Also made it light, without any minification and async/bower/umd loading so that it can be easily included with browserify.

from zxcvbn.

lowe avatar lowe commented on August 23, 2024

Hi Michael, I'm working with the original npm package author now to get
access. I'll fix npm and update the readme as soon as that happens.

On Sunday, July 12, 2015, Michael Heuberger [email protected]
wrote:

I couldn't wait any longer and npm-published a fork
https://github.com/binarykitchen/zxcvbn-npm

Also made it light, without any minification and async/bower/umd loading
so that it can be easily included with browserify.


Reply to this email directly or view it on GitHub
#80 (comment).

from zxcvbn.

lowe avatar lowe commented on August 23, 2024

All fixed. This separate npm repo should no longer be needed but let me know if you still have outstanding issues.

from zxcvbn.

lowe avatar lowe commented on August 23, 2024

(I also included install instructions for browserify, npm, bower, requirejs and manual.)

from zxcvbn.

ericyhwang avatar ericyhwang commented on August 23, 2024

One thing I noticed while updating to use the published NPM module - previously on the server, the require looked like var zxcvbn = require('zxcvbn');, whereas now it's var zxcvbn = require('zxcvbn').zxcvbn;.

I realize NPM support was previously unofficial and that the second way is now the officially documented way. Just wanted to give you a heads-up that you might be breaking people depending on ^1.0.0 and to publish a major rev if you want require('zxcvbn').zxcvbn to be the way going forward.

from zxcvbn.

lowe avatar lowe commented on August 23, 2024

Hey @ericyhwang, the full story here is messy unfortunately. I originally used exports instead of module.exports in init.coffee, in order to support older CommonJS frameworks that don't recognize module.exports (introduced by node and not originally part of CommonJS spec). This leads to the verbose var zxcvbn = require('zxcvbn').zxcvbn;.

The original publisher for the npm module added an index.js file that used modue.exports on top of my exports call, and I didn't catch it. This gives the nicer require syntax but creates an inconsistency.

My plan going forward is to switch exclusively module.exports in an upcoming 2.0 release because that's the better interface moving forward -- I'd be great to shorten var zxcvbn = require('zxcvbn').zxcvbn; to var zxcvbn = require('zxcvbn');.

The v1 series will continue using exports for older frameworks that depend on it.

from zxcvbn.

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.