
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
chance-path
Advanced tools
A Chance.js mixin to generate paths.
$ npm i chance-path
$ yarn add chance-path
import Chance from 'chance';
import path from 'chance-path';
const chance = new Chance();
chance.mixin({
path
});
chance.path();
By default, chance-path will return a randomly generated path.
Example: some/random/path/to/something/somewhere/some.file
Below is a list of available configuration options that you can pass into chance-path.
chance.path({
// options
});
Specifies how deep the path is.
For example, chance.path({depth: 4}) would produce something like path/depth/of/four/random.random.
Defaults to
chance.d6().
Specifies what the file extension is.
For example, chance.path({ext: '.custom'}) would produce something like random/random/random.custom.
Defaults to
chance.word().
Specifies what the file name is.
For example, chance.path({name: 'custom'}) would produce something like random/random/custom.random.
Defaults to
chance.word().
Specifies if the path should be a root path.
For example, chance.path({root: true}) would produce something like /random/random/random.random.
Defaults to
chance.bool().
MIT © Michael Novotny
FAQs
A Chance.js mixin to generate paths.
The npm package chance-path receives a total of 9 weekly downloads. As such, chance-path popularity was classified as not popular.
We found that chance-path demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.