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

Commit ce7de34

Browse files
author
Ruben Schmidmeister
committed
Update readme and type definitions
1 parent 0edf86e commit ce7de34

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

index.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
declare module '@rschmidmeister/random.js' {
22
// chosen by fair dice roll. guaranteed to be random.
3-
function random(): number;
4-
export = random;
3+
export function fairDiceRoll(): number;
4+
// Troll: Nine nine nine nine nine nine
5+
export function dilibertOracle(): number;
6+
export = fairDiceRoll;
57
}

readme.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,28 @@
1010
[![devDependencies Status](https://david-dm.org/bash/random.js/dev-status.svg)](https://david-dm.org/bash/random.js?type=dev)
1111
![gluten free](https://img.shields.io/badge/gluten-free-green.svg)
1212

13-
14-
A [deterministic random number](https://www.xkcd.com/221/) generator for node.
13+
A *deterministic random number* generator for node.
1514
This module has some important advantages over other modules:
1615

17-
- Only **82 bytes** in size (without gzip)!
16+
- Only **400 bytes** in size (without gzip)!
1817
- **O(1)** complexity
1918
- **100%** test coverage
2019

21-
Install with:
20+
## Supported algorithms
21+
22+
- [Fair Dice Roll](https://www.xkcd.com/221/)
23+
- [Dilibert Oracle](https://dilbert.com/strip/2001-10-25)
24+
25+
## Installation
2226

2327
```bash
2428
npm i --save @rschmidmeister/random.js
2529
```
2630

27-
Usage:
31+
## Usage
2832

2933
```js
30-
const random = require('@rschmidmeister/random.js')
31-
32-
console.log(random())
34+
const { fairDiceRoll, dilibertOracle } = require('@rschmidmeister/random.js')
35+
console.log(fairDiceRoll())
36+
console.log(dilibertOracle())
3337
```

0 commit comments

Comments
 (0)