0.0.6 • Published 5 years ago

node-rm v0.0.6

Weekly downloads
15
License
MIT
Repository
github
Last release
5 years ago

šŸ“‘ NodeRM

āœ”ļø remove all extra spaces and comments from files and bundle it into one file

npm.io npm.io

npm i node-rm --save-dev

Usage

const { bundle, rmSpacesComments, readFiles, getFiles, writeOrCreateFile } = require('node-rm')

Methods & Examples

  • bundle(directory: String, outFileName: String): Promise
    bundle all files in directory into one file
bundle('./myDirectory', 'bundle.js')
  • rmSpacesComments(String):String
    remove spaces and comments from a string
rmSpacesComments(`
// comment 
let a = () => { console.log('hello world')}
`)
// let a = () => { console.log('hello world')}
  • getFiles(directory: String): Array
    return files path from directory
getFiles('./tests')
// [ './tests/sub/another-file.js', './tests/first-file.js']
  • readFiles(files: Array): String
    read files and return the content of files
let files = getFiles('./tests') // [ './tests/sub/another-file.js', './tests/first-file.js']
readFiles(files);
  • writeOrCreateFile(data: String, outFileName: String): Promise
    if file exists will write / else will create a new file and write
writeOrCreateFile('hello world', 'out-file.js')

License

MIT

0.0.5

5 years ago

0.0.6

5 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago