# is-optimizable

> A tool that checks for V8 optimization killers

Latest version **1.1.1** (published 2015-01-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install is-optimizable
pnpm add is-optimizable
yarn add is-optimizable
bun add is-optimizable
```

Provides the command `is-optimizable`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2015-01-20 |
| First published | 2015-01-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Marten de Vries |
| Maintainers | commandoline |
| Keywords | optimization, optimize, v8, performance, javascript, tool |

## Links

- npm: https://www.npmjs.com/package/is-optimizable
- Repository: https://github.com/marten-de-vries/is-optimizable
- Issues: https://github.com/marten-de-vries/is-optimizable/issues
- npm.io page: https://npm.io/package/is-optimizable

## Dependencies (5)

- [glob](https://npm.io/package/glob.md) ^4.3.5
- [acorn](https://npm.io/package/acorn.md) ^0.11.0
- [extend](https://npm.io/package/extend.md) ^2.0.0
- [nomnom](https://npm.io/package/nomnom.md) ^1.8.1
- [alphanumeric-sort](https://npm.io/package/alphanumeric-sort.md) 0.0.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2015-01-20
- 1.1.0 — 2015-01-20
- 1.0.1 — 2015-01-19
- 1.0.0 — 2015-01-19

## README

is-optimizable
==============

[![Build Status](https://travis-ci.org/marten-de-vries/is-optimizable.svg?branch=master)](https://travis-ci.org/marten-de-vries/is-optimizable)
[![Dependency Status](https://david-dm.org/marten-de-vries/is-optimizable.svg)](https://david-dm.org/marten-de-vries/is-optimizable)
[![devDependency Status](https://david-dm.org/marten-de-vries/is-optimizable/dev-status.svg)](https://david-dm.org/marten-de-vries/is-optimizable#info=devDependencies)

A tool that checks for V8 optimization killers. Based on the list on the
[bluebird wiki][].

[bluebird wiki]: https://github.com/petkaantonov/bluebird/wiki/Optimization-killers

Usage
-----

```

Usage: is-optimizable <files>... [options]

files     The list of files to check optimizability for.

Options:
   --encoding              Input file encoding  [UTF-8]
   --harmony               Parse as ES6
   --disallow-lonely-try   Don't allow try/catch/finally as only thing inside a function.

```

Example
-------

```
marten@procyon:~/git/is-optimizable$ ./bin/is-optimizable --harmony test/problems.js
test/problems.js: line 1: global code: debugger statement
test/problems.js: line 4: function 'a': debugger statement
test/problems.js: line 7: function 'test': generator function
test/problems.js: line 10: function 'unnamed function': generator function
test/problems.js: line 13: global code: for .. of statement
test/problems.js: line 16: global code: try/finally statement
test/problems.js: line 17: global code: try/catch statement
test/problems.js: line 18: global code: try/catch/finally statement
test/problems.js: line 21: global code: object literal includes a get declaration
test/problems.js: line 24: global code: object literal includes a set declaration
test/problems.js: line 27: global code: object literal includes a __proto__ property
test/problems.js: line 31: global code: possible eval() call
test/problems.js: line 32: global code: possible eval() call
test/problems.js: line 34: global code: with statement
test/problems.js: line 38: global code: switch statement with more than 128 cases
test/problems.js: line 175: function 'c': possibly unsafe 'arguments' usage
test/problems.js: line 190: function 'f': possibly unsafe 'arguments' usage
test/problems.js: line 195: function 'f': reassignment of argument 'a' while 'arguments' is referenced in the same function body
test/problems.js: line 196: function 'f': possibly unsafe 'arguments' usage
test/problems.js: line 211: function 'g': possibly unsafe 'arguments' usage
test/problems.js: line 221: function 'i': possibly unsafe 'arguments' usage
marten@procyon:~/git/is-optimizable$ 
```

Ignore lines
------------

You can ignore warnings by adding a comment containing the text 
'is-optimizable ignore next' exactly *one* line ahead of the line
causing the error. E.g.:

```javascript
var a = 1;
try {} finally {}
var b = 2;
```

becomes:

```javascript
var a = 1;
/* is-optimizable ignore next */
try {} finally {}
var b = 2;
```

Wishlist/TODO
-------------

- compound let assignment - rare so not yet implemented
- compound const assignment - rare so not yet implemented
- check for .. in - it's efficiency is largely runtime dependant though.

PRs welcome!

License
-------

ISC

---
_Source: https://npm.io/package/is-optimizable · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
