Skip to content

Get Global Declarations and Dependencies of a JavaScript resource.

License

Notifications You must be signed in to change notification settings

divyamamgai/skope

Repository files navigation

skope

Used to get global declarations and dependencies of a given javascript resource.

Usage

Declarations

const fs = require('fs')
const skope = require('./skope')

const FILE_PATH = 'PATH_TO_YOUR_SAMPLE_JAVASCRIPT_FILE'

const data = fs.readFileSync(FILE_PATH).toString()

const declarations = skope.getDeclarations(data)

// console.log(declarations)

Dependencies

const fs = require('fs')
const skope = require('./skope')

const FILE_PATH = 'PATH_TO_YOUR_SAMPLE_JAVASCRIPT_FILE'

const data = fs.readFileSync(FILE_PATH).toString()

const dependencies = skope.getDependencies(data)

// console.log(dependencies)

Test

To run tests on the sample javascript files in the test/samples/*.js folder, run the following command -

node test

Releases

No releases published

Packages

No packages published