scanner
v0.0.7
Published
Files & Projects Tools
Downloads
98
Readme
scanner
File System Utilities
API
Package
Create:
const scanner = require('scanner');
// Create package instance
let pack = new scanner.Package('/path/to/package');
Paths:
// Resolve path by package's dirname
let filename = pack.resolve('lib/index.js');
Package:
// Loads `package.json` data
let data = pack.getPackage();
let [major, minor, patch] = pack.getVersion();
Files list:
// Returns list of files and directories of package's directory (relative)
let files = pack.getFiles([subdirectory]);
// Returns list of files and directories of package's directory (absolute)
let files = pack.getFilenames([subdirectory]);
// Returns list of all files and directories of package's directory (recursive, relative)
let files = pack.getFilesRecursive([subdirectory]);
// Returns list of all files and directories of package's directory (recursive, absolute)
let files = pack.getFilenamesRecursive([subdirectory]);