Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/toyobayashi/memfs-browser
https://github.com/toyobayashi/memfs-browser
Last synced: 28 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/toyobayashi/memfs-browser
- Owner: toyobayashi
- Created: 2022-10-22T07:22:19.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-10T07:31:21.000Z (10 months ago)
- Last Synced: 2024-09-18T01:13:44.224Z (about 2 months ago)
- Language: JavaScript
- Size: 43 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
```bash
npm install memfs-browser
```- HTML ``
```html
<script src="your-buffer-polyfill-that-set-globalThis-Buffer">
``````js
// index.js///
console.log(memfs.versions.memfs) // original memfs version
console.log(memfs.versions.build) // version of current build
console.log(memfs.path) // path-browserify
```- HTML ``
```html
<script type="importmap">
{
"imports": {
"memfs-browser": "./node_modules/memfs-browser/dist/memfs.esm.min.js"
}
}
``````js
import * as memfs from 'memfs-browser'console.log(memfs.versions.memfs) // original memfs version
console.log(memfs.versions.build) // version of current build
console.log(memfs.path) // path-browserify
```- Webpack
```bash
npm install buffer
``````js
module.exports = {
resolve: {
alias: {
buffer: require.resolve('buffer/')
}
}
}
``````js
import * as memfs from 'memfs-browser'
// const memfs = require('memfs-browser')console.log(memfs.versions.memfs) // original memfs version
console.log(memfs.versions.build) // version of current build
console.log(memfs.path) // path-browserify
```