Package Exports
- file-js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (file-js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
file-js
Abstract representation of a pathname
Installation
npm install --save file-jsDemo
Features
- File glob matching
- File listings
- File locking
- Assert file permissions
- Supports promises
- Supports synchronous and asynchronous methods
Coming soon
- File matching with regular expressions
- Create temp files
- Create directories via
.mkdirand.mkdirp - Assert existence of files via
.exists() - Watch file
- Change permissions
- Support file URI
- Support for callbacks
Usage
const File = require('file-js');
const file = File.create('myDir');
file.getList()
then((files) => {
files.each(console.log);
});
const file = File.create('myDirectory');
if (file.isDirectorySync()) {
console.log('processing directory');
}Documentation
For more examples and API details, see API documentation
Test
npm testTo generate a test coverage report:
npm run coverageContributing
- If you're unsure if a feature would make a good addition, you can always create an issue first.
- We aim for 100% test coverage. Please write tests for any new functionality or changes.
- Any API changes should be fully documented.
- Make sure your code meets our linting standards. Run
npm run lintto check your code. - Maintain the existing coding style. There are some settings in
.jsbeautifyrcto help. - Be mindful of others when making suggestions and/or code reviewing.