This repository was archived by the owner on Feb 19, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 8 files changed +742
-0
lines changed Expand file tree Collapse file tree 8 files changed +742
-0
lines changed Original file line number Diff line number Diff line change 1+ root = true
2+
3+ [* ]
4+ end_of_line = lf
5+ insert_final_newline = true
6+
7+ [* .{js,json} ]
8+ charset = utf-8
9+ indent_style = space
10+ indent_size = 2
Original file line number Diff line number Diff line change 1+ /npm-debug.log
2+ /node_modules /
Original file line number Diff line number Diff line change 1+ language : node_js
2+ install :
3+ - npm install
4+ - npm install -g codecov istanbul
5+
6+ script :
7+ - ./node_modules/.bin/standard
8+ - istanbul cover ./node_modules/mocha/bin/_mocha --reporter lcovonly -- -R spec
9+ - codecov
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 1+ # 🎲 random.js
2+
3+ [ ![ Build Status] ( https://travis-ci.org/bash/random.js.svg?branch=master )] ( https://travis-ci.org/bash/random.js )
4+ [ ![ codecov] ( https://codecov.io/gh/bash/random.js/branch/master/graph/badge.svg )] ( https://codecov.io/gh/bash/random.js )
5+ [ ![ Standard - JavaScript Style Guide] ( https://img.shields.io/badge/code_style-standard-brightgreen.svg )] ( http://standardjs.com/ )
6+
7+ The first [ deterministic random number function] ( https://www.xkcd.com/221/ ) .
8+ This module has some important advantages over other modules:
9+
10+ - Only ** 25 bytes** in size without Gzip!
11+ - ** O(1)** complexity
12+ - ** 100%** test coverage
13+
14+ Install with:
15+
16+ ```
17+ npm i --save @rschmidmeister/random.js
18+ ```
19+
Original file line number Diff line number Diff line change 1+ module . exports = ( ) => 4
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " @rschmidmeister/random.js" ,
3+ "version" : " 1.0.0" ,
4+ "description" : " " ,
5+ "main" : " index.js" ,
6+ "scripts" : {
7+ "test" : " standard . && mocha"
8+ },
9+ "repository" : {
10+ "type" : " git" ,
11+ "url" : " git+https://github.com/bash/random.js.git"
12+ },
13+ "keywords" : [
14+ " random"
15+ ],
16+ "author" : " Ruben Schmidmeister" ,
17+ "license" : " AGPL-3.0" ,
18+ "bugs" : {
19+ "url" : " https://github.com/bash/random.js/issues"
20+ },
21+ "homepage" : " https://github.com/bash/random.js#readme" ,
22+ "devDependencies" : {
23+ "mocha" : " ^3.2.0" ,
24+ "standard" : " ^9.0.2"
25+ }
26+ }
Original file line number Diff line number Diff line change 1+ 'use strict'
2+
3+ const assert = require ( 'assert' )
4+ const random = require ( '../index' )
5+
6+ describe ( 'random' , ( ) => {
7+ it ( 'should return a random number' , ( ) => {
8+ assert . equal ( 4 , random ( ) )
9+ } )
10+
11+ it ( 'should be a function' , ( ) => {
12+ assert . equal ( 'function' , typeof random )
13+ } )
14+ } )
You can’t perform that action at this time.
0 commit comments