Skip to content

Commit 4c66781

Browse files
committed
Update readme.
1 parent 2806bff commit 4c66781

File tree

1 file changed

+42
-2
lines changed

1 file changed

+42
-2
lines changed

readme.markdown

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
1-
# path-browserify
1+
# path-browserify [![Build Status](https://travis-ci.org/browserify/path-browserify.png?branch=master)](https://travis-ci.org/browserify/path-browserify)
22

3-
the path module from node core for browsers
3+
> The `path` module from Node.js for browsers
4+
5+
This implements the Node.js [`path`](http://nodejs.org/api/path.html) module for environments that do not have it, like browsers.
6+
7+
> `path-browserify` currently matches the **Node.js 10.3** API.
8+
9+
## Install
10+
11+
You usually do not have to install `path-browserify` yourself! If your code runs in Node.js, `path` is built in. If your code runs in the browser, bundlers like [browserify](https://github.com/browserify/browserify) or [webpack](https://github.com/webpack/webpack) include the `path-browserify` module by default.
12+
13+
But if none of those apply, with npm do:
14+
15+
```
16+
npm install path-browserify
17+
```
18+
19+
## Usage
20+
21+
```javascript
22+
var path = require('path')
23+
24+
var filename = 'logo.png';
25+
var logo = path.join('./assets/img', filename);
26+
document.querySelector('#logo').src = logo;
27+
```
28+
29+
## API
30+
31+
See the [Node.js path docs](http://nodejs.org/api/path.html). `path-browserify` currently matches the Node.js 10.3 API.
32+
`path-browserify` only implements the POSIX functions, not the win32 ones.
33+
34+
## Contributing
35+
36+
PRs are very welcome! The main way to contribute to `path-browserify` is by porting features, bugfixes and tests from Node.js. Ideally, code contributions to this module are copy-pasted from Node.js and transpiled to ES5, rather than reimplemented from scratch. Matching the Node.js code as closely as possible makes maintenance simpler when new changes land in Node.js.
37+
This module intends to provide exactly the same API as Node.js, so features that are not available in the core `path` module will not be accepted. Feature requests should instead be directed at [nodejs/node](https://github.com/nodejs/node) and will be added to this module once they are implemented in Node.js.
38+
39+
If there is a difference in behaviour between Node.js's `path` module and this module, please open an issue!
40+
41+
## License
42+
43+
[MIT](./LICENSE)

0 commit comments

Comments
 (0)