cd

cd

chdir in chainer fashion + read file

Showing:

Popularity

Downloads/wk

6.9K

Maintenance

No Maintenance Data Available

Package

Dependencies

0

Size (min+gzip)

0.7KB

License

Type Definitions

Tree-Shakeable

No?

Categories

Readme

cd

Change directory in chaining fashion.

Rules:

1. Reading .json file will strip comments and converte into JSON object.
2. Reading .js file is equivalent of require('dir/to/file')
3. Other files are just read.
4. Supply file as argument on last call. No chaning afterwards.
5. Module is syncro, but if you have good idea how to make it async please let me know.

Usage:

var Cd = require('cd');
var cd = new Cd('.');

// Read lol.json from current directory
var lol = cd('lol.json');

// Read wtf.js from test directory.
var wtf = cd().test('wtf.js');
console.log('wtf:'+JSON.stringify(wtf));

// Chain as you like
var file = cd().dir1().dir2(file_in_dir2);

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial