Undeclared.js
Given an AST ( esprima, acorn, ... ), find all undeclared identifiers and returns them as strings in a Set.
Why
Finding all undeclared identifiers could be used in a number of situations. For instance, this module will be part of another module that will automatically try to import all undeclared identifiers in a given script from a custom library.
Install
npm install undeclared
Usage
const undeclared = esprima = let identifiers = // => Set { "undeclared ids"... }
example.js
$$1 to $$7 are undeclared identifiers across multiple scopes
let i = 42 j = $$1 + i { var k = 41 a * j + $$3 }
Analyse example
const fs = esprima = undeclared = fs // => output => Set { "$$1", "$$2", "$$3", "$$4", "$$5", "$$6", "$$7" }
License
MIT