Skip to content

Commit 85a6bfe

Browse files
authored
Merge pull request #2 from eliot-akira/update-readme
doc: Update README.md to reflect current API
2 parents 3ee850b + 0c3d49c commit 85a6bfe

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,32 @@ This implements the Node.js [`path`][path] module for environments that do not h
88
99
## Install
1010

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-
1511
```
16-
npm install path-browserify
12+
npm install @isomorphic-git/path-browserify
1713
```
1814

1915
## Usage
2016

2117
```javascript
22-
var path = require('path')
18+
import path from '@isomorphic-git/path-browserify';
2319

24-
var filename = 'logo.png';
25-
var logo = path.join('./assets/img', filename);
20+
const filename = 'logo.png';
21+
const logo = path.join('./assets/img', filename);
2622
document.querySelector('#logo').src = logo;
2723
```
2824

25+
Methods under `path` can be imported individually.
26+
27+
```javascript
28+
import { join } from '@isomorphic-git/path-browserify';
29+
```
30+
31+
If your project uses CommonJS, this is also supported.
32+
33+
```javascript
34+
const path = require('@isomorphic-git/path-browserify');
35+
```
36+
2937
## API
3038

3139
See the [Node.js path docs][path]. `path-browserify` currently matches the Node.js 10.3 API.

0 commit comments

Comments
 (0)