path-browserify-esm
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

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>

Readme

Keywords

Package Sidebar

Install

npm i path-browserify-esm

Weekly Downloads

2,506

Version

1.0.6

License

MIT

Unpacked Size

37.6 kB

Total Files

6

Last publish

Collaborators

  • hocti