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

use

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

package.json
{
"name": "use",
"version": "1.0.1",
"version": "1.0.2",
"description": "DRY version of require()",

@@ -5,0 +5,0 @@ "bin": {

@@ -21,9 +21,25 @@ Use.js

'path',
'stream'
'stream',
'xregexp#XRegExp',
'./helper'
));
util.debug('Easy as pie...');
XRegExp.replace(
'x-key-lime',
XRegExp('\\b\\w', 'g'),
function(match) {
return match.toUpperCase();
}
);
helper.doSomethingGrand();
```
Warning: This module does not work in strict mode. Only enable strict mode, if you need it, after the eval statement.
### Warning ###
This module does not work in strict mode. Only enable strict mode, if you need it, *after* the eval statement.
var util = require('util');
var path = require('path');

@@ -8,3 +9,17 @@ exports = module.exports = function use(moduleNames) {

moduleNames.forEach(function (m) {
script += util.format('var %s = require("%s"); ', m, m);
var tokens = m.split('#');
if (tokens.length === 2) {
var moduleName = tokens[0];
var className = tokens[1];
script += util.format(
'var %s = require("%s").%s',
className, moduleName, className)
}
else {
script += util.format(
'var %s = require("%s"); ',
path.basename(m), m);
}
})

@@ -11,0 +26,0 @@

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