1.1.5 • Published 4 years ago

@coder/requirefs v1.1.5

Weekly downloads
2,360
License
MIT
Repository
-
Last release
4 years ago

requirefs

requirefs lets you create a readable and requirable file system from a custom file system provider. For example, you could use this to run a Node package on the browser by packing it into a tar and then loading that on the client through requirefs.

Everything passed to the file system provider will use / as path separators.

import { fromTar } from "./requirefs"

const response = await fetch(uri)
if (response.status !== 200) {
  throw new Error("failed to download")
}
const rfs = fromTar(new Uint8Array(await response.arrayBuffer()))
// Use rfs.provide() to provide any necessary modules.
rfs.require(".")

requirefs has no dependencies unless you use fromZip which requires jszip.

1.1.5

4 years ago

1.1.4

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago