memfs-browser
memfs
UMD and ESM bundle for browser.
The code shipped in this package is not transpiled by babel.
Version explanation
memfs: major.minor.patch --> memfs-browser: major.minor.1{patch:2}{build:2}
example:
3.5.3 --> 3.5.103xx
4.6.0 --> 4.6.100xx
Usage
npm install memfs-browser
-
HTML <script>
<script src="your-buffer-polyfill-that-set-globalThis-Buffer"></script>
<script src="./node_modules/memfs-browser/dist/memfs.min.js"></script>
<script src="./index.js"></script>
console.log(memfs.versions.memfs)
console.log(memfs.versions.build)
console.log(memfs.path)
-
HTML <script type="module">
<script type="importmap">
{
"imports": {
"memfs-browser": "./node_modules/memfs-browser/dist/memfs.esm.min.js"
}
}
</script>
<script src="your-buffer-polyfill-that-set-globalThis-Buffer"></script>
<script type="module" src="./index.js"></script>
import * as memfs from 'memfs-browser'
console.log(memfs.versions.memfs)
console.log(memfs.versions.build)
console.log(memfs.path)
-
Webpack
npm install buffer
module.exports = {
resolve: {
alias: {
buffer: require.resolve('buffer/')
}
}
}
import * as memfs from 'memfs-browser'
console.log(memfs.versions.memfs)
console.log(memfs.versions.build)
console.log(memfs.path)