Perform static analysis on webtasks
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
lib
test
.eslintrc
.gitignore
.npmrc
README.md
package.json

README.md

Analyze webtask code

Usage

const Analyzer = require('webtask-analyzer');

const analyzer = new Analyzer({
    clusterUrl: '...',
    containerName: '...',
    token: '...',
});

const results = await analyzer.findDependenciesInCode('module.exports = ...');

API

export interface AnalyzerOptions {
    clusterUrl: string;
    containerName: string;
    token: string;
}

export interface RequireNode {
    type: 'global' | 'require' | 'require_dynamic';
    spec: string;
    start: number;
    end: number;
    resolved?: any;
}

export class Analyzer {
    constructor(options: AnalyzerOptions) {}

    findDependenciesInCode(code: string): Promise<RequireNode[]> {}
}