Skip to content

Commit

Permalink
Merge pull request #2 from eliot-akira/update-readme
Browse files Browse the repository at this point in the history
doc: Update README.md to reflect current API
  • Loading branch information
jcubic authored Feb 9, 2025
2 parents 3ee850b + 0c3d49c commit 85a6bfe
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,32 @@ This implements the Node.js [`path`][path] module for environments that do not h
## Install

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.

But if none of those apply, with npm do:

```
npm install path-browserify
npm install @isomorphic-git/path-browserify
```

## Usage

```javascript
var path = require('path')
import path from '@isomorphic-git/path-browserify';

var filename = 'logo.png';
var logo = path.join('./assets/img', filename);
const filename = 'logo.png';
const logo = path.join('./assets/img', filename);
document.querySelector('#logo').src = logo;
```

Methods under `path` can be imported individually.

```javascript
import { join } from '@isomorphic-git/path-browserify';
```

If your project uses CommonJS, this is also supported.

```javascript
const path = require('@isomorphic-git/path-browserify');
```

## API

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

0 comments on commit 85a6bfe

Please sign in to comment.