Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

enhanced-require

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enhanced-require

Enhance the require function in node.js with support for loaders which preprocess files. This is a standalone polyfill for features of webpack.

  • 0.1.1
  • npm
  • Socket score

Version published
Weekly downloads
46
decreased by-72.46%
Maintainers
1
Weekly downloads
 
Created
Source

enhanced-require

This module added loader support to node.js.

It offers features availible in webpack to node.js.

Add this line to a node.js module to active the enhanced features in that module.

require = require("enhanced-require")(require.valueOf());

Than you can use them:

var template = require("./my-template.jade");
var fileContent = require("raw!"+__filename);
var html = template({content: fileContent});
var directoryRequire = require.context("raw!./subdir");
var txtFile = directoryRequire("./aFile.txt");

Future Plans

  • require("enhanced-require/install") enables support for all modules.

License

Copyright (c) 2012 Tobias Koppers

MIT (http://www.opensource.org/licenses/mit-license.php)

FAQs

Package last updated on 01 Jul 2012

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc