Home

Awesome

to-file-path npmjs.com The MIT License

Create a filepath from an object path (dot notation), list of arguments, array, number or Arguments object.

code climate standard code style travis build status coverage status dependency status

You might also be interested in ip-filter or to-object-path.

Install

npm i to-file-path --save

Usage

For more use-cases see the tests

const toFilePath = require('to-file-path')

toFilePath

Create filepath from different type of arguments.

Params

Example

var toFilePath = require('to-file-path')

console.log(toFilePath('foo.bar.baz')) // => 'foo/bar/baz'
console.log(toFilePath('foo.bar', 'qux.baz', 'xxx')) // => 'foo/bar/qux/baz/xxx'
console.log(toFilePath('foo', 'qux', 'baz')) // => 'foo/qux/baz'
console.log(toFilePath([1, 2, 3], 'foo', 4, 'bar')) // => '1/2/3/foo/4/bar'
console.log(toFilePath(null, true)) // => 'null/true'
console.log(toFilePath(1, 2, 3)) // => '1/2/3'

Related

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckoCore.tk keybase tunnckoCore tunnckoCore npm tunnckoCore twitter tunnckoCore github