Giter Club home page Giter Club logo

chancejs's Introduction

Chance

Chance Logo

Build Status

Chance - Random generator helper for JavaScript

Homepage: http://chancejs.com

Many more details on http://chancejs.com but this single library can generate random numbers, characters, strings, names, addresses, dice, and pretty much anything else.

It includes the basic building blocks for all these items and is built on top of a Mersenne Twister so it can generate these things with repeatibility, if desired.

Usage

Browser

Chance instantiates itself onto the window. This means that in the simplest case you can just include the script tag then use an instance of Chance immediately.

<script src="chance.js"></script>
<script>
    console.log(chance.string());
</script>

More info

RequireJS

Chance also includes an AMD define so it can be used with RequireJS.

require(['Chance'], function(Chance) {
    // Instantiate
    var chance = new Chance();
   
    // Then just use it:
    var my_random_integer = chance.integer();
});

Node.js

And it can be used in Node.js.

var Chance = require('chance'),
    chance = new Chance();
    
// Get a random zip code
chance.zip();

Author

Victor Quinn

http://victorquinn.com

Please feel free to reach out to me if you have any questions or suggestions.

Contributors

THANK YOU!

 project  : chancejs
 repo age : 5 weeks
 active   : 29 days
 commits  : 162
 files    : 19
 authors  :
   125	Victor Quinn            77.2%
    11	Tim Petricola           6.8%
    10	davmillar               6.2%
     5	Michael Cordingley      3.1%
     3	qjcg                    1.9%
     2	dhilipsiva              1.2%
     2	path411                 1.2%
     2	Kevin Garnett           1.2%
     1	Richard Anaya           0.6%
     1	leesei                  0.6%

This project is licensed under the MIT License so feel free to hack away :)

chancejs's People

Contributors

davmillar avatar dhilipsiva avatar eskimoblood avatar kevingarnett avatar leesei avatar mcordingley avatar path411 avatar qjcg avatar richardanaya avatar timpetricola avatar victorquinn avatar

Watchers

 avatar

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.