nspragg / file-js

Abstract representation of a pathname

Repository from Github https://github.comnspragg/file-jsRepository from Github https://github.comnspragg/file-js

file-js

NPM downloads Build Status Coverage Status github-issues stars forks

Abstract representation of a pathname

Installation

npm install --save file-js

Demo

Features

  • File glob matching
  • File listings
  • Assert file permissions
  • Supports promises
  • Supports synchronous and asynchronous methods
  • Supports recursive operations (copy/delete)

Usage

const File = require('file-js');

const file = File.create('myDir');
const files = await file.getList();
files.forEach(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

About

Abstract representation of a pathname

License:Other


Languages

Language:TypeScript 53.2%Language:JavaScript 30.0%Language:CSS 16.8%