1.0.4 • Published 5 months ago

path-browserify-esm v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

path-browserify-esm npm version

The path module from Node.js for browsers

  • forked from path-browserify , and combined with @types/path-browserify

  • converted to ES6 Modules (ESM)

  • added new method: path.setCWD(path: string) The original path-browserify would fail when calling resolve in browser, as it calls process.cwd() internally. Now, the CWD can be manually set (default is empty string)

  • path.process_cwd:string get the current CWD

/ path-browserify-esm / index.esm.js

Setup

NPM Install

	npm install path-browserify-esm

CDN Install

Via jsDelivr:

<script src="https://cdn.jsdelivr.net/npm/path-browserify-esm/index.esm.js" type="module"></script>
    <script type="module">
        import path from 'https://cdn.jsdelivr.net/npm/path-browserify-esm/index.esm.js';
        console.log(path.join('asd','zxc','../qwe/rty')); //asd/qwe/rty
        path.setCWD('http://192.168.1.1')
        console.log(path.resolve('asd','zxc','../qwe/rty')); //http:/192.168.1.1/asd/qwe/rty
    </script>
1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago