New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

node-resolve-flow

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-resolve-flow

Isomorphic node resolve algorithm for any file system (in-browser or Node)

latest
Source
npmnpm
Version
0.8.0
Version published
Weekly downloads
3
200%
Maintainers
1
Weekly downloads
 
Created
Source

node-resolve-flow

Isomorphic node resolve algorithm for any file system (in-browser or Node)

This module abstracts the node module resolution algorithm (loosely following the spec at https://nodejs.org/api/esm.html#esm_resolver_algorithm_specification, correcting its "imprecisions") as a flow (a generator function) given an abstract file system interface

Usage:

import resolver from 'node-resolve-flow';

const resolve = resolver({ isFile, loadPkgJSON });

resolve will be a flow (a generator function) which takes 2 parameters: importee and importer and returning the file URL of the resolved module if successful, and throws or returns undefined if unsuccessful, where

  • isFile(fileURL): a user-supplied flow that should return true if object represented by fileURL exists and is a file
  • loadPkgJSON(fileURL): a user-supplied flow that should load the package.json file located at fileURL

Note: since the resolver is working with generators you would need a generator runner i.e ConclureJS or Redux Saga to make use of it.

Keywords

isomorphic

FAQs

Package last updated on 02 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts