Gathering detailed insights and metrics for burp-brightscript
Gathering detailed insights and metrics for burp-brightscript
npm install burp-brightscript
Typescript
Module System
Node Version
NPM Version
67.7
Supply Chain
96.5
Quality
73.4
Maintenance
100
Vulnerability
97.9
License
Total Downloads
2,540
Last Day
1
Last Week
20
Last Month
49
Last Year
427
Minified
Minified + Gzipped
Latest Version
0.4.2
Package Id
burp-brightscript@0.4.2
Unpacked Size
61.06 kB
Size
15.15 kB
File Count
40
NPM Version
5.6.0
Node Version
9.9.0
Cumulative downloads
Total Downloads
Last day
-66.7%
1
Compared to previous day
Last week
66.7%
20
Compared to previous week
Last month
96%
49
Compared to previous month
Last year
29%
427
Compared to previous year
27
Burp is an independent open-source project, maintained exclusively by volunteers.
You might want to help! Get in touch via the slack group, or raise issues.
It's a simple tool for executing regex replacements on source code files, a bit like awk. The killer feature is that it understands brightscript syntax, so it knows what line and function it's in. It can be used from command line, or from a js environment (such as when using gulp for building)
The following working gulpfile can be found in my roku MVVM spike; but the process is as follows.
npm install burp-brightscript --save-dev
export function addDevLogs(cb) {
let config: BurpConfig = {
"sourcePath": "build/.roku-deploy-staging",
"globPattern": ["**/*.brs","**/*.bs"],
"replacements": [
{
"regex": "(^.*(logInfo|logError|logVerbose|logDebug)\\((\\s*\"))",
"replacement": "$1#FullPath# "
},
{
"regex": "(^.*(logMethod)\\((\\s*\"))",
"replacement": "$1#FullPath# "
}
]
}
const processor = new BurpProcessor(config);
processor.processFiles();
cb();
}
npm install -g burp-brightscript
burpConfig.json
containing:{
"sourcePath": "build/.roku-deploy-staging",
"globPattern": ["**/*.brs"],
"replacements": [
{
"regex": "(^.*(logInfo|logError|logVerbose|logDebug)\\((\\s*\"))",
"replacement": "$1#FullPath# "
},
{
"regex": "(^.*(logMethod)\\((\\s*\"))",
"replacement": "$1#FullPath# "
}
]
}
burp burpConfig.json
You can use the following constants in your regex replacements:
#FullPath#
- full path of file#LineNumber#
- line number of replacement#FileName#
- filename of replacement#FunctionName#
- function name of replacement#CommentLine#
- will result in the line being commented outI like the name. It doesn't mean anything.
Note, you should invoke burp BEFORE you transpile, until further notice - this is because the line numbers will be completely wrong in your transpiled code. Burp will rename all file paths in the output from .bs to .brs Here's a gulp example of how you can achieve this (please feel free to put up a pr with docs improvements, for a better suggestion) - the following is for mac/linux:
export async function compile(cb) {
// copy all sources to tmp folder
// so we can add the line numbers to them prior to transpiling
await copyFiles();
await sleep(100);
await applyBurpPreprocessing();
let builder = new ProgramBuilder();
await builder.run({
stagingFolderPath: outDir,
createPackage: false,
"rootDir": tmpBuildDir,
"autoImportComponentScript": true,
});
}
public async copyFiles() {
let oldPath = path.resolve(process.cwd());
try {
let outPath = path.resolve(this.config.outputPath);
fs.mkdirSync(this.config.outputPath);
let sourcePaths = this.config.sourcePaths.map((p) => {
p = path.resolve(p);
p = p.endsWith('/') ? p : p + '/';
if (!fs.existsSync(p)) {
feedbackError(new File(p, '', '', ''), `cannot find source path ${p}`, true);
}
return p;
}).join(' ');
await exec(`rsync -az ${sourcePaths} ${outPath}`);
console.log(`files copied to ${outPath} dir is now ${process.cwd()}`);
} catch (err) {
console.error(err);
}
process.chdir(oldPath);
}
I also made rLog and needed a tool that could process source files to insert the line number and function name. I figured this is a more generally useful way of doing it, which other's might leverage in their own tool-chains and build processes.
No vulnerabilities found.
No security vulnerabilities found.