@frctl/ffs
v0.2.1
Published
Fractal filesystem utilities
Downloads
9
Keywords
Readme
ffs
Fractal filesystem utilities.
API
.readDir(src)
Reads a directory (or directories) of files and represents them as File objects. Returns a Promise.
src
: Directory path (or array of paths) to read from [required]
const fs = require('@frctl/fs');
fs.readDir('path/to/files').then(files => {
console.log(files);
});
.cloneFile(file[, props])
Clone a File, optionally overwriting it's properties with those from props
.
file
: Instance ofFile
that should be cloned [required]props
: Set of properties to overwrite on the cloned file
const fs = require('@frctl/fs');
const file = new fs.File({
path: '/path/to/file.js',
contents: Buffer.from('The file contents')
});
const cloned = fs.cloneFile(file, {
path: '/path/to/foo.js'
});
Installation
npm i @frctl/ffs --save
Requirements
Node >= v6.0 is required.