get-global-identifiers

Returns an array of global identifiers for a given js file.

Usage no npm install needed!

<script type="module">
  import getGlobalIdentifiers from 'https://cdn.skypack.dev/get-global-identifiers';
</script>

README

get-global-identifiers Build Status

Returns an array of global identifiers for a given js file.

Installing

npm install get-global-identifiers

Example usage

const getGlobals = require('get-global-identifiers');

const globals = getGlobals('app/appConstants.js') // ['GLOBAL', 'CONSTANTS', 'DEFINED', 'IN', 'THIS', 'FILE']