
Research
/Security News
npm Author Qix Compromised via Phishing Email in Major Supply Chain Attack
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
acquit-ignore
Advanced tools
Acquit plugin for removing lines of code from output
By default, acquit-ignore
will attach a transform to acquit
that removes any code in a block that's between
'// acquit:ignore:start' and '// acquit:ignore:end'.
const acquit = require('acquit');
require('acquit-ignore')();
var contents = [
'describe(\'test\', function() {',
' it(\'works\', function(done) {',
' // acquit:ignore:start',
' setup();',
' // acquit:ignore:end',
' var x = 1;',
' // acquit:ignore:start',
' assert.equal(x, 1);',
' // acquit:ignore:end',
'',
' setTimeout(function() {',
' assert.equal(x, 2);',
' // acquit:ignore:start',
' done();',
' // acquit:ignore:end',
' }, 0);',
' ++x;',
' });',
'});'
].join('\n');
const blocks = acquit.parse(contents);
assert.equal(blocks.length, 1);
assert.equal(blocks[0].blocks[0].contents, 'works');
const expectedCode = [
'var x = 1;',
'',
'setTimeout(function() {',
' assert.equal(x, 2);',
'}, 0);',
'++x;',
].join('\n');
assert.equal(blocks[0].blocks[0].code, expectedCode);
Don't like 'acquit:ignore:start' and 'acquit:ignore:end'? Set your own by setting the 'start' and 'end' options.
const acquit = require('acquit');
require('acquit-ignore')({
start: '// bacon',
end: '// eggs'
});
const contents = [
'describe(\'test\', function() {',
' it(\'works\', function(done) {',
' var x = 1;',
' // acquit:ignore:start',
' assert.equal(x, 1);',
' // acquit:ignore:end',
'',
' setTimeout(function() {',
' assert.equal(x, 2);',
' // bacon',
' done();',
' // eggs',
' }, 0);',
' ++x;',
' });',
'});'
].join('\n');
const blocks = acquit.parse(contents);
assert.equal(blocks.length, 1);
assert.equal(blocks[0].blocks[0].contents, 'works');
const expectedCode = [
'var x = 1;',
'// acquit:ignore:start',
'assert.equal(x, 1);',
'// acquit:ignore:end',
'',
'setTimeout(function() {',
' assert.equal(x, 2);',
'}, 0);',
'++x;'
].join('\n');
assert.equal(blocks[0].blocks[0].code, expectedCode);
By default, acquit-ignore attaches itself to the acquit singleton. However, you can also attach it to an acquit instance.
const instance = require('acquit')();
require('acquit-ignore')(instance, {
start: '// bacon',
end: '// eggs'
});
const contents = [
'describe(\'test\', function() {',
' it(\'works\', function(done) {',
' var x = 1;',
' // bacon',
' assert.equal(x, 1);',
' // eggs',
'',
' setTimeout(function() {',
' assert.equal(x, 2);',
' // bacon',
' done();',
' // eggs',
' }, 0);',
' ++x;',
' });',
'});'
].join('\n');
const blocks = instance.parse(contents);
assert.equal(blocks.length, 1);
assert.equal(blocks[0].blocks[0].contents, 'works');
const expectedCode = [
'var x = 1;',
'',
'setTimeout(function() {',
' assert.equal(x, 2);',
'}, 0);',
'++x;'
].join('\n');
assert.equal(blocks[0].blocks[0].code, expectedCode);
FAQs
Acquit plugin for removing lines of code from output
We found that acquit-ignore 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
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.