Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including password-maker with all npm packages installed. Try it out:

var passwordMaker = require("password-maker")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

password-maker v1.1.4

Generate a password randomly

password-maker pipeline status

Generate a password randomly (optimized).


password-maker can be used like described below:

  var generatePassword = require("password-maker");

  // get a 8-character random password
  var shortPassword = generatePassword(8);

  // get a 32-character password with advanced options
  var options = {
    uppercase: false,
    symbols  : false,
    numbers  : true
  var longPassword = generatePassword(options, 32);

What if ?

I declare a negative password length ?

Min password length is 4, if you set -1 or 3, length will be automatically set to 4.

I set a wrong option type ?

Behavior could be defined following this


Installing password-maker

  npm install password-maker --save

Run Tests

Tests are written with mocha/chai.

  $ npm test



  • Fix issue with password requirement generation
  • Add unit tests


  • Remove lodash from dependencies
  • Upgrade devDependencies
  • Add a min password size


  • Fix typo


  • Add examples in
  • Make function 'generatePassword' callable


  • Fix typo in


  • Update file


  • Fix a bug with password index overwritten
  • Add more unit test !


  • Add password generation
  • Add unit test


  • First release, everything was hard-coded
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free