REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.22 KB
Close
/home/byroehnu/.trash/node_modules11/is-reference/README.md
Text
Base64
# is-reference Utility for determining whether an AST node is a reference. `foo` is a reference in these cases: ```js console.log( foo ); var foo; function foo () {} function bar ( foo ) {} export { foo as x }; ``` `foo` is *not* a reference in these cases: ```js var obj = { foo: 1 }; console.log( obj.foo ); export { x as foo }; ``` In all cases, `foo` is an `Identifier` node, but the two kinds must be treated differently for the purposes of scope analysis etc. (The examples are non-exhaustive.) ## Installation ```bash npm install is-reference ``` ## Usage Example using [Acorn](https://github.com/ternjs/acorn) and [estree-walker](https://github.com/Rich-Harris/estree-walker): ```js const { parse } = require( 'acorn' ); const { walk } = require( 'estree-walker' ); const isReference = require( 'is-reference' ); const identifiers = []; const references = []; const ast = parse( `var a = b.c;` ); walk( ast, { enter ( node, parent ) { if ( node.type === 'Identifier' ) identifiers.push( node ); if ( isReference( node, parent ) ) references.push( node ); } }); identifiers.forEach( node => console.log( node.name ) ); // a, b, c references.forEach( node => console.log( node.name ) ); // a, b ``` ## License MIT
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 3
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
dist
DIR
-
drwxr-xr-x
2026-02-28 00:27:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CHANGELOG.md
609 B
lrw-r--r--
2026-02-28 00:27:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
package.json
1.18 KB
lrw-r--r--
2026-02-28 00:26:54
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
README.md
1.22 KB
lrw-r--r--
2026-02-28 00:27:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).