random-depth

1.0.1 • Public • Published

random-depth

Generate a random depth, in meters. Depths are always negative.

MIT License

build:? coverage:?

Install

$ npm install --save random-depth 

Usage

var randomDepth = require('random-depth');
 
// API
// - randomDepth();
// - randomDepth(options);
 
// options:
// - min  : default -10994
// - max  : default 0
// - fixed: default 5
 
randomDepth();
// => -2126.95039

By default, includes 5 digits of accuracy after the decimal. Can override with the fixed option.

randomDepth({ fixed: 2 })
// => -1542.11

By default, maximum (or minimum depending on your frame of reference) depth of -2550 (depth of the Mariana Trench), but this can be overridden with the min option.

randomDepth({ min: -1000 })
// => -718.41976

Related

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.

Package Sidebar

Install

npm i random-depth

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • bubkoo