JSPM

pathogen

0.1.5
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • 0
    • Score
      100M100P100Q28380F
    • License MIT

    sane path utilities for node.js

    Package Exports

    • pathogen

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pathogen) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Pathogen

    Pathogen is an object oriented path utility library for node.js and browsers.

    Usage

    var pathogen = require('pathogen');
    
    // objects
    var path = new pathogen('some/file.txt');
    path.dirname().toString(); // './some/'
    path.resolve().toString(); // '/process/cwd/some/file.txt'
    path.resolve('/other/folder').toString(); // '/other/folder/some/file.txt'
    path.toWindows().toString(); // '.\\some\\file.txt'
    path.relative('some/otherfile.txt').toString(); // './otherfile.txt'
    path.basename(); // 'file.txt'
    
    // shortcuts
    pathogen.dirname('some/file.txt'); // './some/'
    pathogen.extname('some/file.txt'); // '.txt'
    pathogen.nix('\\windows\\system32\\'); // '/windows/system32/'
    pathogen.win('c:\\windows\\system32\\'); // 'c:\\windows\\system32\\'
    pathogen.sys('./some/path/'); // unix: './some/path/' windows: '.\\some\\path\\'
    pathogen.cwd() // unix: '/process/cwd/some/path/' windows: 'c:\\process\\cwd\\some\\path\\'