
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
istanbul-jpm
Advanced tools
Istanbul Instrumenter and coverage export for Firefox Add-on SDK extensions tested with JPM.
Run npm install --save-dev istanbul-jpm
in the root of your extension directory.
The index of this module exports the Instrumenter from istanbul adapted for use
with JPM. It does so by storing the coverage variable in a special object, that
gets written to the disk after all tests are done. This means, that this module
has to be packaged into the XPI file when running jpm test
to measure coverage.
Note that istanbul doesn't need to be packaged with it.
var Instrumenter = require("istanbul-jpm").Instrumenter;
The "global" that the Instrumenter wrote to can be accessed in node like this:
const g = require("istanbul-jpm/global-node").global;
The module reads the data from the disk and returns it in object form on the "global" property.
You might want to set the directory used to pass the coverage information from
the extension back to node using the environment variable coveragedir
. By
default, it will use node's and Firefox's idea of the system's temp directory.
It is known that those do not match up on Max OS X.
Also uses grunt-shell to launch jpm test
.
module.exports = function(grunt) {
var istanbulJpm = require("istanbul-jpm");
// Make sure Firefox writes the coverage info to the same dir we'll read from.
process.env.coveragedir = require("os").tmpdir();
grunt.initConfig({
shell: {
jpmTest: {
command: 'jpm test'
}
},
instrument: {
files: 'lib/**/*.js',
options: {
lazy: true,
basePath: 'coverage/instrument/',
instrumenter: istanbulJpm.Instrumenter
}
},
storeCoverage: {
options: {
dir: 'coverage/reports'
}
},
makeReport: {
src: 'coverage/reports/**/*.json',
options: {
type: 'lcov',
dir: 'coverage/reports',
print: 'detail'
}
}
});
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-istanbul');
grunt.registerTask('readcoverageglobal', 'Reads the coverage global JPM wrote', function() {
global.__coverage__ = require("istanbul-jpm/global-node").global.__coverage__;
grunt.log.ok("Read __coverage__ global");
});
grunt.registerTask('test', ['instrument', 'shell:jpmTest', 'readcoverageglobal', 'storeCoverage', 'makeReport']);
};
FAQs
An istanbul Instrumenter for use with JPM
We found that istanbul-jpm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.