Skip to content

The path module from Node.js for browsers, using es module

Notifications You must be signed in to change notification settings

Hocti/path-browserify-esm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>

About

The path module from Node.js for browsers, using es module

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 77.2%
  • HTML 22.8%