# slash2

> Convert Windows backslash paths to slash paths

Latest version **2.0.0** (published 2018-06-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install slash2
pnpm add slash2
yarn add slash2
bun add slash2
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2018-06-01 |
| First published | 2018-06-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 0 |
| Unpacked size | 2.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Sindre Sorhus |
| Maintainers | sorrycc |
| Keywords | path, seperator, sep, slash, backslash, windows, win |

## Links

- npm: https://www.npmjs.com/package/slash2
- Repository: https://github.com/sorrycc/slash2
- Homepage: https://github.com/sorrycc/slash2#readme
- Issues: https://github.com/sorrycc/slash2/issues
- npm.io page: https://npm.io/package/slash2

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 2.0.0 (latest) — 2018-06-01

## README

# slash [![Build Status](https://travis-ci.org/sindresorhus/slash.svg?branch=master)](https://travis-ci.org/sindresorhus/slash)

> Convert Windows backslash paths to slash paths: `foo\\bar` ➔ `foo/bar`

[Forward-slash paths can be used in Windows](http://superuser.com/a/176395/6877) as long as they're not extended-length paths and don't contain any non-ascii characters.

This was created since the `path` methods in Node outputs `\\` paths on Windows.


## Install

```
$ npm install slash
```


## Usage

```js
const path = require('path');
const slash = require('slash');

const str = path.join('foo', 'bar');
// Unix    => foo/bar
// Windows => foo\\bar

slash(str);
// Unix    => foo/bar
// Windows => foo/bar
```


## API

### slash(path)

Type: `string`

Accepts a Windows backslash path and returns a slash path.


## License

MIT © [Sindre Sorhus](https://sindresorhus.com)

---
_Source: https://npm.io/package/slash2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
