Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cfware/fixture-run-directory
Base class for building daemons within a fixture run directory.
https://github.com/cfware/fixture-run-directory
Last synced: 29 days ago
JSON representation
Base class for building daemons within a fixture run directory.
- Host: GitHub
- URL: https://github.com/cfware/fixture-run-directory
- Owner: cfware
- License: mit
- Created: 2020-10-02T13:03:38.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-10-15T20:01:36.000Z (about 1 year ago)
- Last Synced: 2024-11-17T14:07:33.238Z (about 1 month ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @cfware/fixture-run-directory [![NPM Version][npm-image]][npm-url]
Base class for building daemons within a fixture run directory.
```js
import path from 'path';
import {FixtureRunDirectory} from '@cfware/fixture-run-directory';const fixtures = path.resolve('fixtures');
const instance0 = new FixtureRunDirectory({instanceID: 'instance0', fixtures});console.log(instance0.instanceID);
// => instance0console.log(instance0.fixtureDirectory);
// => $CWD/fixturesconsole.log(instance0.fixturePath('dir', 'file'));
// => $CWD/fixtures/dir/fileconsole.log(instance0.runDirectory);
// => $CWD/fixtures/instances/instance0console.log(instance0.runPath('dir', 'file'));
// => $CWD/fixtures/instances/instance0/dir/fileconst instance1 = new FixtureRunDirectory({instanceID: 'instance1'});
console.log(instance1.runDirectory);
// => $CWD/fixtures/instances/instance1
```### new FixtureRunDirectory({fixturePath, instanceID})
`fixturePath` defaults to `process.resolve(process.cwd(), 'fixtures')`. The value
for `process.cwd()` is taken when this module is loaded.`instanceID` must be provided and be a valid filesystem directory name.
[npm-image]: https://img.shields.io/npm/v/@cfware/fixture-run-directory.svg
[npm-url]: https://npmjs.org/package/@cfware/fixture-run-directory