Socket
Book a DemoInstallSign in
Socket

node-module-resolution

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-module-resolution

Use to make your own module loaders. A compliant node module loader base without any fs.

Source
npmnpm
Version
0.0.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

node-module-resolution

Use to make your own amazing module loaders.

Implements the "spec" defined in the node docs

import {NodeModuleResolution} from 'node-module-resolution'

const files = new Map([
    ['/node_modules/a-module/package.json',{getData:()=>Buffer.from('{"main":"seahorse.js"}')}],
    ['/node_modules/a-module/seahorse.js',{getData:()=>Buffer.from("console.log('javascript')")}]
])

let nmr = new NodeModuleResolution(files)
let result = nmr.resolve('a-module',{id:'/a.js',filename:'/a.js',paths:[]})

console.log('should resolve seahorse by reading main. ',result)

todo

  • make amazing test suite for this.
  • examples
  • everything else

notes

This is not an official google product.

Keywords

module

FAQs

Package last updated on 28 Sep 2018

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