Nanika ARchive (*.nar) loader
npm install narloader
import * as NarLoader from "narloader";
const buffer = (nar data ArrayBuffer);
NarLoader.loadFromBuffer(buffer).then((directory) => ...);
You can bundle NarLoader by webpack / browserify with BrowserFS' instruction.
/**
* load nar from path
* @param narPath nar file path
*/
export async function loadFromPath(narPath: string): Promise<NanikaContainerSyncDirectory>;
/**
* load nar from URI
* @param narUri nar file URI
*/
export async function loadFromURI(narUri: URL | string): Promise<NanikaContainerSyncDirectory>;
/**
* load nar from buffer
* @param nar nar file buffer
*/
export async function loadFromBuffer(nar: string | ArrayBuffer | Uint8Array | Buffer | Blob): Promise<NanikaContainerSyncDirectory>;
This is released under MIT License.