# undeclared-identifiers

> find undeclared identifiers and property accesses in a javascript file.

Latest version **1.1.3** (published 2019-02-24) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install undeclared-identifiers
pnpm add undeclared-identifiers
yarn add undeclared-identifiers
bun add undeclared-identifiers
```

Provides the command `undeclared-identifiers`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2019-02-24 |
| First published | 2018-03-10 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 15.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Renée Kooi |
| Maintainers | goto-bus-stop |
| Keywords | ast, check, detect, identifiers, javascript, undeclared |

## Links

- npm: https://www.npmjs.com/package/undeclared-identifiers
- Repository: https://github.com/goto-bus-stop/undeclared-identifiers
- Issues: https://github.com/goto-bus-stop/undeclared-identifiers/issues
- npm.io page: https://npm.io/package/undeclared-identifiers

## Dependencies (5)

- [xtend](https://npm.io/package/xtend.md) ^4.0.1
- [dash-ast](https://npm.io/package/dash-ast.md) ^1.0.0
- [acorn-node](https://npm.io/package/acorn-node.md) ^1.3.0
- [simple-concat](https://npm.io/package/simple-concat.md) ^1.0.0
- [get-assigned-identifiers](https://npm.io/package/get-assigned-identifiers.md) ^1.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.1.3 (latest) — 2019-02-24
- 1.1.2 — 2018-05-18
- 1.1.1 — 2018-05-18
- 1.1.0 — 2018-05-18
- 1.0.0 — 2018-03-10

## README

# undeclared-identifiers

find undeclared identifiers and property accesses in a javascript file.

[![npm][npm-image]][npm-url]
[![travis][travis-image]][travis-url]
[![standard][standard-image]][standard-url]

[npm-image]: https://img.shields.io/npm/v/undeclared-identifiers.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/undeclared-identifiers
[travis-image]: https://img.shields.io/travis/goto-bus-stop/undeclared-identifiers.svg?style=flat-square
[travis-url]: https://travis-ci.org/goto-bus-stop/undeclared-identifiers
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[standard-url]: http://npm.im/standard

## Install

```
npm install undeclared-identifiers
```

## Usage

```js
var undeclaredIdentifiers = require('undeclared-identifiers')

undeclaredIdentifiers(src)
// { identifiers: ['Buffer'],
//   properties: ['Buffer.isBuffer'] }
```

## API

### `res = undeclaredIdentifiers(source, opts)`

Find undeclared identifiers and properties that are used in the `source`. `source` can be an AST or a source string that will be parsed using [acorn-node](https://github.com/browserify/acorn-node).

`res` is an object with properties:

  - `res.identifiers` - an array of variable names as strings.
  - `res.properties` - an array of property names as .-separated strings, such as `'xyz.abc'`. These are the property accesses on the undeclared variables found in `res.identifiers`.

Set `opts.properties` to false to only return identifiers.

When `opts.wildcard` is true, unknown uses of undeclared identifiers will be added to `res.properties` as `'VarName.*'`.

```js
undeclaredIdentifiers('Buffer(), Buffer.from()', { wildcard: true })
// { identifiers: ['Buffer'],
//   properties: ['Buffer.*', 'Buffer.from'] }
```

## License

[Apache-2.0](LICENSE.md)

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