0.0.4 • Published 8 years ago

@nathanfaucett/file_path v0.0.4

Weekly downloads
9
License
MIT
Repository
github
Last release
8 years ago

filePath

file path utils for the browser and node.js

var filePath = require("@nathanfaucett/file_path");


filePath.isAbsolute("../path") === false;
filePath.isAbsolute("path") === false;
filePath.isAbsolute("/path") === true;

filePath.normalize("//base//path///to") === "/base/path/to";

filePath.resolve("/base/path/to", "../", "./") === "/base/path";

filePath.relative("/base/path", "/base/path/home") === "home";

filePath.join("/base/path", "./home") === "/base/path/home";

filePath.dirname("/base/path/file") === "/base/path";

filePath.basename("/base/path/file") === "file";
filePath.basename("/base/path/file.js") === "file.js";

filePath.extname("/base/path/file.js") === ".js";