micro-fs

File system and globbing utilities

Usage no npm install needed!

<script type="module">
  import microFs from 'https://cdn.skypack.dev/micro-fs';
</script>

README

micro-fs

File system and globbing utilities

NPM version NPM downloads Build Status Coverage Status Dependency Status Greenkeeper badge


Install

$ npm install micro-fs -S

Usage

const mfs = require('micro-fs');

mfs.copy('src/**/*.js', 'lib').then(() => {
  console.log('copy done.');
});

mfs.move('src/**/*.js', 'lib').then(() => {
  console.log('move done.');
});

mfs.delete('dist/**').then(() => {
  console.log('delete done.');
});

mfs.zip('src/**/*.js', 'source.zip').then(() => {
  console.log('archive done.');
});

mfs.glob('src/**/*.js', options).then(files => {
  console.log(files);
  /**
   * [{ cwd, base, path }]
   */
});

API

  • mfs.copy(src, dest, options) => Promise
  • mfs.move(src, dest, options) => Promise
  • mfs.zip(src, dest, options) => Promise
  • mfs.glob(src, options) => Promise
  • mfs.delete(src, options) => Promise

src is globs and options are documented in glob-stream.

Report a issue

License

micro-fs is available under the terms of the MIT License.