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

require-extension-hooks-module

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

require-extension-hooks-module

Parse import/export statements in node modules

latest
Source
npmnpm
Version
0.1.4
Version published
Maintainers
1
Created
Source

require-extension-hooks-module

Parse import/export statements in node modules. No need to include the entire babel-core library if node supports 99% of ES6 syntax already!

Installation

npm install require-extension-hooks require-extension-hooks-module --save-dev

Usage

const hooks = require('require-extension-hooks');
hooks('js').plugin('module');

You can now use the import/export syntax in your nodejs files. require-extension-hooks-module will transpile modules into module.exports and require() statements.

Examples

exports:

export default {};
export const myConstant = {};
export function myFunction(){};

const foo = {}, bah = {}, zoo = {};
export {foo, bah, zoo as Zoo};

imports:

import defaultValue from './foo';
import * as all from './foo';
import {myConstant, myFunction} from './foo';
import {foo, bah, Zoo as zoo} from './foo';

FAQs

Package last updated on 10 Jul 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