Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.

Commit 4641511

Browse files
author
Ruben Schmidmeister
committed
Initial commit
0 parents  commit 4641511

File tree

8 files changed

+742
-0
lines changed

8 files changed

+742
-0
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/npm-debug.log
2+
/node_modules/

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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

LICENSE

Lines changed: 661 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = () => 4

package.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
}

test/test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
})

0 commit comments

Comments
 (0)