0.0.1 • Published 10 years ago
file-meta v0.0.1
file-meta

Get useful information about files
Install
$ npm install --save file-metaUsage
var fileMeta = require('file-meta');
var myFile = fileMeta('/home/wolfika/Documents/gulpfile.babel.js');
myFile.getName();
//=> 'gulpfile'
myFile.getFullName();
//=> 'gulpfile.babel.js'
myFile.getExtension();
//=> ['babel', 'js']API
fileMeta(filePath)
filePath
Type: string
Path/name of the file you wish to inspect.
.getName()
Returns the name of the file, excluding the extension. In case the file is a dotfile (e.g. .travis.yml), the full name is returned (.travis.yml).
.getFullName()
Returns the full name of the file, including the extension.
.getExtension()
Returns a string if the file has one single extension, or an array of extensions, if it has multiple. Returns null if the file has no extension (e.g. dotfiles, Gemfile).
License
MIT © Mate Farkas
0.0.1
10 years ago