npm

Need private packages and team management tools?Check out npm Orgs. »

fsstatwithpath

1.1.3 • Public • Published

fsstatwithpath

Current Version Build Status Coverage Status

fs.stat With Path Included To Callback Result

Installation

$ npm install fsstatwithpath

or

$ yarn add fsstatwithpath

Usage

Directory

var fswp = require("fsstatwithpath");
 
fswp("node_modules", (err, stats) => {
    if (err) {
        console.log("directory (error) => [" + err.code + "" + err.path);
    }
    else {
        console.log("directory (success) => " + stats.path);
    }
});
 
fswp("xnode_modules", (err, stats) => {
    if (err) {
        console.log("directory (error) => [" + err.code + "" + err.path);
    }
    else {
        console.log("directory (success) => " + stats.path);
    }
});
 
// OUTPUT
// directory (success) => node_modules
// directory (error) => [ENOENT] xnode_modules

File

var fswp = require("fsstatwithpath");
 
fswp("package.json", (err, stats) => {
    if (err) {
        console.log("file (error) => [" + err.code + "" + err.path);
    }
    else {
        console.log("file (success) => " + stats.path);
    }
});
 
fswp("xpackage.json", (err, stats) => {
    if (err) {
        console.log("file (error) => [" + err.code + "" + err.path);
    }
    else {
        console.log("file (success) => " + stats.path);
    }
});
 
// OUTPUT
// file (success) => package.json
// file (error) => [ENOENT] xpackage.json

Tests

$ npm test

or

$ yarn test

License

MIT

install

npm i fsstatwithpath

Downloadsweekly downloads

2

version

1.1.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability