0.9.0 • Published 9 years ago

@fav/path.format v0.9.0

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

@fav/path.format NPM version

Provides same behaviors of path.format module for all versions of node.js

Install

For installing @fav/path with npm:

$ npm install @fav/path --save

For installing only @fav/path.format with npm:

$ npm install @fav/path.format --save

Usage

When installing @fav/path:

const path = require('@fav/path');

path.format({ dir: 'path/to', base: 'file.ext' });
// => path/to/file.ext

path.format({ dir: 'path/to', name: 'file', ext: '.ext' });
// => path/to/file.ext

When installing @fav/path.format:

const format = require('@fav/path.format');

format({ dir: 'path/to', base: 'file.ext' });
// => path/to/file.ext

format({ dir: 'path/to', name: 'file', ext: '.ext' });
// => path/to/file.ext

API

format(pathObject)

Returns a path string from an object.

Arguments
  • pathObject object :

    pathObject can has following properties:

    • dir : a string for a directory.
    • root : a string for a root. This property is used if dir property is not supplied.
    • base : a string for a base name.
    • name : a string for a file name without an extension. This property is used if base property is not supplied.
    • ext : a string for an extension. This property is used if base property is not supplied.
Errors

License

Copyright (C) 2016 Takayuki Sato

This program is free software under MIT License. See the file LICENSE in this distribution for more details.

0.9.0

9 years ago

0.8.0

9 years ago

0.7.0

9 years ago

0.6.0

9 years ago

0.5.0

9 years ago

0.4.0

9 years ago

0.3.0

9 years ago