const bfs = require('bestikk-fs')
// Synchronously remove 'confidential' directory recursively
bfs.removeSync('confidential');
// Synchronously create 'foo', 'bar' and 'baz' directories
bfs.mkdirsSync('foo/bar/baz');
// Synchronously copy 'foo' directory and all its content to 'bar' directory
bfs.copySync('foo', 'bar');
// Walk through a directory and call the callback function on each file
bfs.walk('foo', (path, stat) => console.log('path: ' + path + ', stat:' + stat))
// Asynchronously untar 'foo.tar.gz' to 'bar' directory (and rename tar base directory to 'qux')
bfs.untar('foo.tar.gz', 'qux', 'bar')
.then(() => /* do something */)
// Synchronously concat the content of 'foo', 'bar', 'baz' files into 'quz'
bfs.concatSync(['foo', 'bar', 'baz'], 'quz');
// Synchronously copy 'foo' file to 'bar' directory (ie. file will be copied to 'bar/foo')
bfs.copyToDirSync('foo', 'bar');
// Synchronously update the version in 'package.json' with '1.0.0'
bfs.updateFileSync('package.json', /"version": "(.*?)"/g, '"version": "1.0.0"');
-
Notifications
You must be signed in to change notification settings - Fork 0
A simple tool to do common file operations.
License
bestikk/bestikk-fs
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
A simple tool to do common file operations.