Socket
Book a DemoInstallSign in
Socket

@larsthorup/local

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@larsthorup/local

Simplify requiring local modules

0.6.3
latest
Source
npmnpm
Version published
Weekly downloads
20
Maintainers
1
Weekly downloads
 
Created
Source

node-local-require

npm version Build Status

Simplify requiring local modules

The purpose of this module is to make it easy to keep self-contained Node modules in the same repo as the rest of your app during initial development, in such a way that you can easily convert the module to be a real external module eventually.

Usage

npm install @larsthorup/local --save

var local = require('@larsthorup/local');
var config = local('config');

Verification

You can optionally declare local modules in dependency order in package.json. If so, local() will verify requests against the declaration, unless NODE_ENV is production:

{ 
  "config": {
    "@larsthorup/local": {
      "modules": [
        "core",
        "lib"
      ]
    }
  }
}

var util = local('util'); // Note: will throw an error

var core = local('core'); // Note: will succeed if in some source file in lib

var lib = local('lib'); // Note: will throw an error if in some source file in core 

FAQs

Package last updated on 02 Apr 2021

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.