Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
istanbul-react
Advanced tools
Instrumenter for 1:1 mapping of React JSX components, can be used with karma-coverage
$ npm install --save-dev istanbul-react
Use with karma-coverage
coverageReporter: {
instrumenters: { 'istanbul-react' : require('istanbul-react') }
instrumenter: {
'**/*.jsx': 'istanbul-react'
},
// ...
}
You can also just use it directly
var instrumenter = new require('istanbul-react').Instrumenter({});
instrumenter.instrument(content, path, function(err, instrumentedCode) {
// ...
});
You can use modifyCodeBeforeInstrumentation
to modify code before instrumentation. It might be useful for example to get around chrome bug with 'use strict';
. It takes one argument, which give you an object, with two properties code
- original code, filename
- name of the file. This callback must return modified code as a string. In the example below you can see how 'use strict';
is prefixed with semi-colon to work around bug (or feature?) in chrome.
coverageReporter: {
instrumenters: { 'istanbul-react' : require('istanbul-react') }
instrumenter: {
'**/*.jsx': 'istanbul-react'
},
instrumenterOptions: {
'istanbul-react': {
modifyCodeBeforeInstrumentation: function fixChromeBugWithUseStrict(params) {
return params.code.replace(/(['"]use strict['"];)/g, ';$1');
}
}
},
// ...
}
$ npm test
MIT © Podio
FAQs
Instrumenter for 1:1 mapping of React JSX components
The npm package istanbul-react receives a total of 21 weekly downloads. As such, istanbul-react popularity was classified as not popular.
We found that istanbul-react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.