Today's npm package: is-glob
I am developer from India currently based in Berlin, Germany.
I am very interested in Design, though I don't design ๐ I take care of it while making my apps.
Photography, videography and having random conversation over beer are my activities of spare time. Timelapses and hyperlapses make me wonder all the time ๐
Today's npm package is is-glob
While creating Node.js based CLIs which is working with Files and Directories; you might wanna work with Glob .
And when working with Glob, you need to know when the passed argument is a glob or not.
The package is-glob will help you in this case and it will return true only when the passed string is a Glob
const fs = require('fs');
const path = require('path');
const isGlob = require('is-glob');
const file = process.argv.slice(2);
if (isGlob(file)) {
// process the Glob
return;
}
// process the file
const fileData = fs.readFileSync(path.resolve(process.cwd(), file));
Stay tuned for tomorrow's package of the Day.




