next-path
One step closer to your destination.
Last updated 9 years ago by sholladay .
MPL-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install next-path 
SYNC missed versions from official npm registry.

next-path Build status for next-path on Circle CI.

One step closer to your destination.

Like an incremental path.relative().

Why?

  • Walk the file system without messy state.
  • Works well with functional programming styles.
  • Flexible about user input.

Install

npm install next-path --save

Usage

Get it into your program.

const nextPath = require('next-path');

Determine the next path, one step closer to the destination.

console.log(nextPath('a', 'a/b/c'));  // => 'a/b'
console.log(nextPath('../', '../../../'));  // => '../..'

API

nextPath(from, to)

from

Type: string

The base path that both to and the result will be relative to.

to

Type: string

The path you want to move one step closer to.

Contributing

See our contributing guidelines for more details.

  1. Fork it.
  2. Make a feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request.

License

MPL-2.0 © Seth Holladay

Go make something, dang it.

Current Tags

  • 1.0.0                                ...           latest (9 years ago)

2 Versions

  • 1.0.0                                ...           9 years ago
  • 0.1.0                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (3)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |