cwp

1.0.1 • Public • Published

cwp

npm travis standard downloads

Get a path string relative to the current working directory.

i.e., Current Working Path.

About

It just pass arguments to path.join with process.cwd() prepended.

A very minimal (perhaps totally unnecessary) shortcut.

Install

npm install cwp

Usage

var cwp = require('cwp')
var file = cwp('path/to', 'file')

Unix filesystem notation, strings for each entity, or a mix of both are all supported. The API is the same as path.join -- the only difference is that the current working directory is always automatically prepended.

Example

Given the process is running in /Users/ng/dev/github/cwp/, here are some example outputs.

cwp('package.json')
// -> '/Users/ng/dev/github/cwp/package.json'
 
cwp('test', 'index.js')
// -> '/Users/ng/dev/github/cwp/test/index.js'
 
cwp('lib/secret/dir', 'file')
// -> '/Users/ng/dev/github/cwp/lib/secret/dir/file'
 
cwp('../../../.ssh/id_rsa')
// -> '/Users/ng/.ssh/id_rsa'

Tests

npm install
npm test

Contributing

Contributions welcome! Please read the contributing guidelines before getting started.

License

ISC

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i cwp

    Weekly Downloads

    2

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    7.41 kB

    Total Files

    8

    Last publish

    Collaborators

    • ungoldman