Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

fildes-extra

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fildes-extra

Extends fildes promises with rm -rf, cp -r and mkdir -p

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
26
-53.57%
Maintainers
1
Weekly downloads
 
Created
Source

Fildes Extra

Build Status Dependencies Dev Dependencies

Extends fildes with glob, cpy, rimraf and trash/empty-trash.

Install

npm i --save fildes-extra

Examples

var files = require('fildes-extra');

// make dir
files.mkdir('./a/new/dir')
.then(function(){
    // remove dir
    return files.rmdir('./a/new');
})
.then(function(){
    // copy dir
    return files.copy(['./a'], './b');
})
.then(function(){
    console.log('done!');
})
.catch(function(error){
    console.error(error);
})

find (pattern)

Promise fildes.find alias fildes.glob uses glob (NPM Documentation).

fildes.find('**/*.{jpg,png}')
.then(function(images){
    console.log('found', images.length, 'images')
})

rm (path)

Promise fildes.rm alias fildes.rmdir uses rimraf (NPM Documentation).

fildes.rm('./path/to/dir')
.then(function(){
    console.log('directory removed!');
});

copy (files, destination, [options])

Promise fildes.cp alias fildes.copy uses cpy (NPM Documentation).

fildes.cp(['./data/*.txt'], './destination')
.then(function(){
    console.log('directory copied!');
});

trash (files)

Promise trash uses trash (NPM Documentation).

fildes.trash(['./data/file.txt'])
.then(function(){
    console.log('directory copied!');
});

emptyTrash ()

Promise empty-trash uses empty-trash (NPM Documentation).

fildes.emptyTrash()
.then(function(){
    console.log('trash emptied!');
});

Test

WARNING: tests will empty your trash!

npm test

# debug all
DEBUG=fildes* npm test

Keywords

promise

FAQs

Package last updated on 13 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts