Skip to content

Fix example with optional parameter in readme #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .verb.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Usage

```js
var unixify = require('{%= name %}');
const unixify = require('{%= name %}');
unixify(filepath[, stripTrailingSlash]);
```

Expand Down Expand Up @@ -43,6 +43,6 @@ By passing `false` as the second argument


```js
unixify('one//two//////three//'), //=> 'one/two/three/'
unixify('C:\\one\\two\\three\\'); //=> '/one/two/three/'
unixify('one//two//////three//', false), //=> 'one/two/three/'
unixify('C:\\one\\two\\three\\', false); //=> '/one/two/three/'
```
64 changes: 36 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# unixify [![NPM version](https://img.shields.io/npm/v/unixify.svg?style=flat)](https://www.npmjs.com/package/unixify) [![NPM monthly downloads](https://img.shields.io/npm/dm/unixify.svg?style=flat)](https://npmjs.org/package/unixify) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/unixify.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/unixify)
# unixify [![NPM version](https://img.shields.io/npm/v/unixify.svg?style=flat)](https://www.npmjs.com/package/unixify) [![NPM monthly downloads](https://img.shields.io/npm/dm/unixify.svg?style=flat)](https://npmjs.org/package/unixify) [![NPM total downloads](https://img.shields.io/npm/dt/unixify.svg?style=flat)](https://npmjs.org/package/unixify) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/unixify.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/unixify)

> Convert Windows file paths to unix paths.

Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.

## Install

Install with [npm](https://www.npmjs.com/):
Expand All @@ -10,16 +12,10 @@ Install with [npm](https://www.npmjs.com/):
$ npm install --save unixify
```

Install with [yarn](https://yarnpkg.com):

```sh
$ yarn add unixify
```

## Usage

```js
var unixify = require('unixify');
const unixify = require('unixify');
unixify(filepath[, stripTrailingSlash]);
```

Expand Down Expand Up @@ -60,25 +56,32 @@ unixify('C:\\one\\two\\three\\'); //=> '/one/two/three'
By passing `false` as the second argument

```js
unixify('one//two//////three//'), //=> 'one/two/three/'
unixify('C:\\one\\two\\three\\'); //=> '/one/two/three/'
unixify('one//two//////three//', false), //=> 'one/two/three/'
unixify('C:\\one\\two\\three\\', false); //=> '/one/two/three/'
```

## About

### Related projects
<details>
<summary><strong>Contributing</strong></summary>

* [contains-path](https://www.npmjs.com/package/contains-path): Return true if a file path contains the given path. | [homepage](https://github.com/jonschlinkert/contains-path "Return true if a file path contains the given path.")
* [ends-with](https://www.npmjs.com/package/ends-with): Returns `true` if the given `string` or `array` ends with `suffix` using strict equality for… [more](https://github.com/jonschlinkert/ends-with) | [homepage](https://github.com/jonschlinkert/ends-with "Returns `true` if the given `string` or `array` ends with `suffix` using strict equality for comparisons.")
* [is-absolute](https://www.npmjs.com/package/is-absolute): Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute. | [homepage](https://github.com/jonschlinkert/is-absolute "Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute.")
* [normalize-path](https://www.npmjs.com/package/normalize-path): Normalize file path slashes to be unix-like forward slashes. Also condenses repeat slashes to a… [more](https://github.com/jonschlinkert/normalize-path) | [homepage](https://github.com/jonschlinkert/normalize-path "Normalize file path slashes to be unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes unless disabled.")
* [path-ends-with](https://www.npmjs.com/package/path-ends-with): Return `true` if a file path ends with the given string/suffix. | [homepage](https://github.com/jonschlinkert/path-ends-with "Return `true` if a file path ends with the given string/suffix.")
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

### Contributing
</details>

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
<details>
<summary><strong>Running Tests</strong></summary>

### Building docs
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

```sh
$ npm install && npm test
```

</details>

<details>
<summary><strong>Building docs</strong></summary>

_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_

Expand All @@ -88,26 +91,31 @@ To generate the readme, run the following command:
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```

### Running tests
</details>

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
### Related projects

```sh
$ npm install && npm test
```
Other useful libraries for working with paths in node.js:

* [contains-path](https://www.npmjs.com/package/contains-path): Return true if a file path contains the given path. | [homepage](https://github.com/jonschlinkert/contains-path "Return true if a file path contains the given path.")
* [ends-with](https://www.npmjs.com/package/ends-with): Returns `true` if the given `string` or `array` ends with `suffix` using strict equality for… [more](https://github.com/jonschlinkert/ends-with) | [homepage](https://github.com/jonschlinkert/ends-with "Returns `true` if the given `string` or `array` ends with `suffix` using strict equality for comparisons.")
* [is-absolute](https://www.npmjs.com/package/is-absolute): Returns true if a file path is absolute. Does not rely on the path module… [more](https://github.com/jonschlinkert/is-absolute) | [homepage](https://github.com/jonschlinkert/is-absolute "Returns true if a file path is absolute. Does not rely on the path module and can be used as a polyfill for node.js native `path.isAbolute`.")
* [normalize-path](https://www.npmjs.com/package/normalize-path): Normalize slashes in a file path to be posix/unix-like forward slashes. Also condenses repeat slashes… [more](https://github.com/jonschlinkert/normalize-path) | [homepage](https://github.com/jonschlinkert/normalize-path "Normalize slashes in a file path to be posix/unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes, unless disabled.")
* [path-ends-with](https://www.npmjs.com/package/path-ends-with): Return `true` if a file path ends with the given string/suffix. | [homepage](https://github.com/jonschlinkert/path-ends-with "Return `true` if a file path ends with the given string/suffix.")

### Author

**Jon Schlinkert**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
* [GitHub Profile](https://github.com/jonschlinkert)
* [Twitter Profile](https://twitter.com/jonschlinkert)
* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)

### License

Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Copyright © 2021, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 14, 2017._
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on January 06, 2021._