1.1.3 • Published 7 years ago

fsstatwithpath v1.1.3

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

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

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago