Skip to content

Latest commit

 

History

History
41 lines (27 loc) · 1014 Bytes

README.md

File metadata and controls

41 lines (27 loc) · 1014 Bytes

@file-services/resolve

npm version package size

Isomorphic, fs-agnostic implementation of the Node resolution algorithm.

Implements the following behaviors:

Getting started

Install library in project:

npm i @file-services/resolve

Then, use the programmatic API:

import { createRequestResolver } from "@file-services/resolve";
import { createMemoryFs } from "@file-services/memory";

const fs = createMemoryFs({
  "some-folder": {
    "index.js": "some content",
  },
});

const resolveRequest = createRequestResolver({ fs });

resolveRequest("/", "./some-folder");
// === '/some-folder/index.js'

License

MIT