@file-services/utils
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -1,5 +0,5 @@ | ||
export * from './sync-to-async-fs'; | ||
export * from './callbackify'; | ||
export * from './create-extended-api'; | ||
export * from './directory-fs'; | ||
export * from './set-multi-map'; | ||
export * from './sync-to-async-fs'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -6,6 +6,6 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./sync-to-async-fs")); | ||
__export(require("./callbackify")); | ||
__export(require("./create-extended-api")); | ||
__export(require("./directory-fs")); | ||
__export(require("./set-multi-map")); | ||
__export(require("./sync-to-async-fs")); | ||
//# sourceMappingURL=index.js.map |
@@ -19,4 +19,4 @@ "use strict"; | ||
}, | ||
async readdir(directoryPath) { | ||
return syncFs.readdirSync(directoryPath); | ||
readdir: async function readdir(...args) { | ||
return syncFs.readdirSync(...args); | ||
}, | ||
@@ -23,0 +23,0 @@ async mkdir(directoryPath) { |
@@ -1,5 +0,5 @@ | ||
export * from './sync-to-async-fs'; | ||
export * from './callbackify'; | ||
export * from './create-extended-api'; | ||
export * from './directory-fs'; | ||
export * from './set-multi-map'; | ||
export * from './sync-to-async-fs'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,5 +0,5 @@ | ||
export * from './sync-to-async-fs'; | ||
export * from './callbackify'; | ||
export * from './create-extended-api'; | ||
export * from './directory-fs'; | ||
export * from './set-multi-map'; | ||
export * from './sync-to-async-fs'; | ||
//# sourceMappingURL=index.js.map |
@@ -17,4 +17,4 @@ import { callbackify } from './callbackify'; | ||
}, | ||
async readdir(directoryPath) { | ||
return syncFs.readdirSync(directoryPath); | ||
readdir: async function readdir(...args) { | ||
return syncFs.readdirSync(...args); | ||
}, | ||
@@ -21,0 +21,0 @@ async mkdir(directoryPath) { |
{ | ||
"name": "@file-services/utils", | ||
"description": "Common file system utility functions.", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"main": "cjs/index.js", | ||
@@ -11,8 +11,6 @@ "module": "esm/index.js", | ||
"build": "ts-build ./src --cjs --esm", | ||
"test": "mocha -r @ts-tools/node/r \"test/**/*.spec.ts?(x)\" --watch-extensions ts,tsx --colors", | ||
"prepack": "yarn build" | ||
}, | ||
"dependencies": { | ||
"@file-services/posix-path": "^1.0.1", | ||
"@file-services/types": "^1.0.3" | ||
"@file-services/types": "^1.0.4" | ||
}, | ||
@@ -32,3 +30,3 @@ "files": [ | ||
"sideEffects": false, | ||
"gitHead": "fdcdf94689d021a2ed845fd1e68d09759892efc2" | ||
"gitHead": "5324bae9c23054284cb0727692dae2b6a1cb1560" | ||
} |
@@ -10,24 +10,5 @@ # @file-services/utils | ||
- `syncToAsyncFs`: convert a sync-only file system implementation into an async one. | ||
- `createDirectoryFs`: A file system wrapper that adds directory scoping to any `IFileSystem` implementation. | ||
# Usage | ||
## License | ||
## Directory scoped file system | ||
Install library in project: | ||
```sh | ||
yarn add @file-services/utils | ||
``` | ||
Then, use the programmatic API: | ||
```ts | ||
import { nodeFs } from '@file-services/node' | ||
import { createDirectoryFs } from '@file-services/utils' | ||
const directoryFs = createDirectoryFs(nodeFs, '/path/to/some/folder') | ||
// will be written to /path/to/some/folder/file.js | ||
directoryFs.writeFileSync('/file.js', 'SAMPLE') | ||
// returns 'SAMPLE' | ||
directoryFs.readFileSync('/file.js') | ||
``` | ||
MIT |
@@ -1,4 +0,4 @@ | ||
export * from './sync-to-async-fs'; | ||
export * from './callbackify'; | ||
export * from './create-extended-api'; | ||
export * from './directory-fs'; | ||
export * from './set-multi-map'; | ||
export * from './sync-to-async-fs'; |
@@ -23,5 +23,5 @@ import { IBaseFileSystemSync, IBaseFileSystemAsync, IBaseFileSystemPromiseActions } from '@file-services/types'; | ||
async readdir(directoryPath) { | ||
return syncFs.readdirSync(directoryPath); | ||
}, | ||
readdir: async function readdir(...args: [string]) { | ||
return syncFs.readdirSync(...args); | ||
} as IBaseFileSystemPromiseActions['readdir'], | ||
@@ -71,3 +71,3 @@ async mkdir(directoryPath) { | ||
unlink: callbackify(syncFs.unlinkSync), | ||
readdir: callbackify(syncFs.readdirSync), | ||
readdir: callbackify(syncFs.readdirSync) as IBaseFileSystemAsync['readdir'], | ||
mkdir: callbackify(syncFs.mkdirSync), | ||
@@ -74,0 +74,0 @@ rmdir: callbackify(syncFs.rmdirSync), |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
1
91897
48
1376
14
- Removed@file-services/posix-path@^1.0.1
- Removed@file-services/posix-path@1.0.3(transitive)
Updated@file-services/types@^1.0.4