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

crspr

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crspr

Self modifying files toolkit

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

crspr

Self modifying files toolkit

Dependencies

No dependencies!

Installation (node.js)

$ npm install crspr

Usage

Replace this;

function registerGlobal(moduleName, asName) {

    if (!global[asName]) {
        console.info('reistered global', moduleName, 'as', asName);
        global[asName] = require(moduleName);
    }
}

var preGlobals = [
    ['Path', 'path'],
    ['Url', 'url'],
    ['Promise', 'bluebird'],
    ['Enum', 'enum'],
    ['FS', 'fs']
];

preGlobals.forEach(function(pair){
    registerGlobal(pair[1], pair[0]);
})

...with this;

/*** A-START ***/
/*** T-END ***/

var preGlobals = [
    ['Path', 'path'],
    ['Url', 'url'],
    ['Promise', 'bluebird'],
    ['Enum', 'enum'],
    ['FS', 'fs']
];

var crspr = require('crspr');
var util = require('util');
var replaceMentLines = preGlobals.map(function (pair) {
                                         var asName = pair[0], moduleName = pair[1];
                                         return util.format('global[\'%s\'] = require(\'%s\');', asName, moduleName);
                                     });

crspr('/*** A-START ***/', '/*** T-END ***/', replaceMentLines);

...and rUN!

FAQs

Package last updated on 24 Jan 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

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