From 7c5aa4e4138774782787209f4bd5bbdb0ef3a973 Mon Sep 17 00:00:00 2001 From: eliot-akira Date: Sat, 8 Feb 2025 16:13:38 +0100 Subject: [PATCH 1/2] doc: Update README.md to reflect current API --- README.md | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c4f218b..d9b8ecf 100644 --- a/README.md +++ b/README.md @@ -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'; -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'; +``` + +If your project uses CommonJS, this is also supported. + +```javascript +const path = require('@isomorphic-git/path'); +``` + ## API See the [Node.js path docs][path]. `path-browserify` currently matches the Node.js 10.3 API. From 0c3d49c00e3053fecfedf2ee44b6bfc10f6520a4 Mon Sep 17 00:00:00 2001 From: eliot-akira Date: Sun, 9 Feb 2025 14:06:20 +0100 Subject: [PATCH 2/2] Use correct package name @isomorphic-git/path-browserify --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d9b8ecf..c1e0d4e 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ npm install @isomorphic-git/path-browserify ## Usage ```javascript -import path from '@isomorphic-git/path'; +import path from '@isomorphic-git/path-browserify'; const filename = 'logo.png'; const logo = path.join('./assets/img', filename); @@ -25,13 +25,13 @@ document.querySelector('#logo').src = logo; Methods under `path` can be imported individually. ```javascript -import { join } from '@isomorphic-git/path'; +import { join } from '@isomorphic-git/path-browserify'; ``` If your project uses CommonJS, this is also supported. ```javascript -const path = require('@isomorphic-git/path'); +const path = require('@isomorphic-git/path-browserify'); ``` ## API