# es-lookup-scope

> Look up the scoop of an estree compatible node

Latest version **1.0.1** (published 2015-04-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install es-lookup-scope
pnpm add es-lookup-scope
yarn add es-lookup-scope
bun add es-lookup-scope
```

## 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.0.1 |
| Published | 2015-04-03 |
| First published | 2015-04-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Graeme Yeates |
| Maintainers | megawac |
| Keywords | ast, scope, get scope, acorn |

## Links

- npm: https://www.npmjs.com/package/es-lookup-scope
- Repository: https://github.com/megawac/es-lookup-scope
- Issues: https://github.com/megawac/es-lookup-scope/issues
- npm.io page: https://npm.io/package/es-lookup-scope

## Dependencies (3)

- [escope](https://npm.io/package/escope.md) ^1.0.3
- [es6-collections](https://npm.io/package/es6-collections.md) ^0.5.1
- [lodash.findlast](https://npm.io/package/lodash.findlast.md) ^3.2.0

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2015-04-03
- 1.0.0 — 2015-04-02

## README

# es-lookup-scope
[![Travis build status](http://img.shields.io/travis/megawac/es-lookup-scope.svg?style=flat)](https://travis-ci.org/megawac/es-lookup-scope)
[![Code Climate](https://codeclimate.com/github/megawac/es-lookup-scope/badges/gpa.svg)](https://codeclimate.com/github/megawac/es-lookup-scope)
[![Test Coverage](https://codeclimate.com/github/megawac/es-lookup-scope/badges/coverage.svg)](https://codeclimate.com/github/megawac/es-lookup-scope)
[![Dependency Status](https://david-dm.org/megawac/es-lookup-scope.svg)](https://david-dm.org/megawac/es-lookup-scope)
[![devDependency Status](https://david-dm.org/megawac/es-lookup-scope/dev-status.svg)](https://david-dm.org/megawac/es-lookup-scope#info=devDependencies)

Using [escope](https://github.com/estools/escope) we find the scope of any estree compatible AST node.

```js
import {parse} from 'acorn';
import lookup from 'es-lookup-scope';
import {traverse} from 'estraverse'

let ast = parse(`
      (function() {
        const x = 2;
        try {
          const x = 1;
          [1, 2, 3].map(x => x);
        } catch(o_O) {}
        console.log(x);
      })();
      module.exports = {
        x() {
          let y = this;
          console.log(y);
        }
      }
    `, { ecmaVersion: 6});
    
traverse(ast, {
    enter(node) {
        console.log(lookup(node));
    }
});
```

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