New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dejavu-optimizer

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dejavu-optimizer

The dejavu optimizer

  • 0.4.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

dejavu optimizer

The dejavu optimizer analyzes your code, making dejavu usages faster.
Benchmarks: jsperf

What it does?

  • Improves $super(), $self and $static usage
  • Removes the need for wrappers, improving performance by a great margin
  • Removes abstract functions from abstract classes
  • Removes functions from interfaces
  • Removes all $locked and $member() because they are not used in the loose version

Usage

Node script

There's a simple nodejs script located in the bin folder. If you are optimizing your code for nodejs then pass the --closure option. This will boost the performance when running code in v8. Please look at the jsperf results to see the difference in the different browsers.

Example usage:

node optimizer < file_in.js > file_out.js node optimizer --closure < file_in.js > file_out.closure.js

Programmatic

To use the optimizer programatically, please check bin/optimizer for an example.

Tasks

dejavu comes with an automaton and grunt task.

Sample usage of automaton:

var dejavuOptimizer = require('dejavu/tasks/optimizer.autofile');

module.exports = function (task) {
    task.do(dejavuOptimizer, {
        description: 'Optimize myfile',
        options: {
            closure: true, // defaults to false
            files: {
                'src/myfile.js': 'dst/myfile.opt.js'
            }
        }
    });
}

Sample usage of grunt:

grunt.loadNpmTasks('dejavu');

grunt.initConfig({
    dejavuopt: {
        sometarget: {
            closure: true, // defaults to false
            files: {
                'dst/myfile.opt.js': 'src/myfile.js'
            }
        }
    }
});

License

Released under the MIT License.

Keywords

FAQs

Package last updated on 24 Jan 2014

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