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

require-all-context

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

require-all-context

[![Build Status](https://travis-ci.org/jonjaques/require-all-context.svg?branch=master)](https://travis-ci.org/jonjaques/require-all-context)

latest
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

Require All for Webpack contexts

Build Status

Usage

requireAll(context: WebpackContext, options?: Options)

interface Options {
  ext: string;
  formatKey(x: string): string;
}
const requireAll = require('require-all-context')
var stuffContext = require.context('./stuff', true, /\.js$/)
var stuff = requireAll(stuffContext)

Output

The following directory structure

/stuff
  bar.js
  foo.js
  /nested
    zap.js
    /weirdly-named-folder
      things.js

produces the following object

{ 
  bar: ..., 
  foo: ..., 
  nested: {
    zap: ...,
    weirdlyNamedFolder: {
      things: ...
    }
  } 
}

FAQs

Package last updated on 05 Sep 2017

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