@absolunet/fss
Advanced tools
Comparing version 0.3.0 to 0.3.1
16
index.js
@@ -6,4 +6,4 @@ //-------------------------------------------------------- | ||
const fs = require('fs'); | ||
const fsx = require('fs-extra'); | ||
const fs = require('fs'); | ||
const fsExtra = require('fs-extra'); | ||
@@ -19,10 +19,10 @@ | ||
copy: fsx.copySync, | ||
ensureDir: fsx.ensureDirSync, | ||
remove: fsx.removeSync, | ||
copy: fsExtra.copySync, | ||
ensureDir: fsExtra.ensureDirSync, | ||
remove: fsExtra.removeSync, | ||
move: (source, dest, options) => { | ||
fsx.copySync(source, dest, options); | ||
fsx.removeSync(source); | ||
move: (src, dest, options) => { | ||
fsExtra.copySync(src, dest, options); | ||
fsExtra.removeSync(src); | ||
} | ||
}; |
{ | ||
"name": "@absolunet/fss", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "fs / fs-extra sync wrapper", | ||
@@ -20,13 +20,13 @@ "definition": "", | ||
"engines": { | ||
"node": ">= 8.0.0" | ||
"node": ">= 8.5.0" | ||
}, | ||
"scripts": { | ||
"test": "mocha" | ||
"test": "ava test" | ||
}, | ||
"devDependencies": { | ||
"@absolunet/tester": "0.0.5" | ||
"@absolunet/tester": "1.1.0" | ||
}, | ||
"dependencies": { | ||
"fs-extra": "^3.0.1" | ||
"fs-extra": "^4.0.2" | ||
} | ||
} |
@@ -10,3 +10,79 @@ # @absolunet/fss | ||
## License | ||
See the [license](https://github.com/absolunet/node-fss/blob/master/license). | ||
## Install | ||
```sh | ||
$ npm install @absolunet/fss | ||
``` | ||
## Usage | ||
```js | ||
const fss = require('@absolunet/fss'); | ||
fss.move('/path1/path2/path3', '/path4'); | ||
``` | ||
## API | ||
### copy(src, dest, [options]) | ||
Maps [`fsExtra.copySync`](https://github.com/jprichardson/node-fs-extra/blob/master/docs/copy-sync.md). | ||
### ensureDir(dir) | ||
Maps [`fsExtra.ensureDirSync`](https://github.com/jprichardson/node-fs-extra/blob/master/docs/ensureDir-sync.md). | ||
### exists(path) | ||
Maps [`fs.existsSync`](https://nodejs.org/api/fs.html#fs_fs_existssync_path). | ||
### move(src, dest, [options]) | ||
Simulate a [`mv(1)`](http://man7.org/linux/man-pages/man1/mv.1.html) via a [`fsExtra.copySync`](https://github.com/jprichardson/node-fs-extra/blob/master/docs/copy-sync.md) and a [`fsExtra.removeSync`](https://github.com/jprichardson/node-fs-extra/blob/master/docs/remove-sync.md). | ||
#### src | ||
*Required* | ||
Type: `string` | ||
Path of dir/file to move. | ||
#### dest | ||
*Required* | ||
Type: `string` | ||
Path of destination. | ||
#### options | ||
Type: `Object` | ||
`fsExtra.copySync` options. | ||
### readdir(path[, options]) | ||
Maps [`fs.readdirSync`](https://nodejs.org/api/fs.html#fs_fs_readdirsync_path_options). | ||
### readFile(path[, options]) | ||
Maps [`fs.readFileSync`](https://nodejs.org/api/fs.html#fs_fs_readfilesync_path_options). | ||
### realpath(path[, options]) | ||
Maps [`fs.realpathSync`](https://nodejs.org/api/fs.html#fs_fs_realpathsync_path_options). | ||
### remove(path) | ||
Maps [`fsExtra.removeSync`](https://github.com/jprichardson/node-fs-extra/blob/master/docs/remove-sync.md). | ||
### symlink(target, path[, type]) | ||
Maps [`fs.symlinkSync`](https://nodejs.org/api/fs.html#fs_fs_symlinksync_target_path_type). | ||
### writeFile(file, data[, options]) | ||
Maps [`fs.writeFileSync`](https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options). | ||
## License | ||
MIT © [Absolunet](https://absolunet.com) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4741
88
4
+ Addedfs-extra@4.0.3(transitive)
+ Addedjsonfile@4.0.0(transitive)
- Removedfs-extra@3.0.1(transitive)
- Removedjsonfile@3.0.1(transitive)
Updatedfs-extra@^4.0.2