JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 117936
  • Score
    100M100P100Q143233F
  • License MIT

Abstract representation of a pathname

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

Build Status Coverage Status

Abstract representation of a pathname

Installation

npm install --save file-js

Demo

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 .mkdir and .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 test

To generate a test coverage report:

npm run coverage

Contributing

  • 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 lint to check your code.
  • Maintain the existing coding style. There are some settings in .jsbeautifyrc to help.
  • Be mindful of others when making suggestions and/or code reviewing.