npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

acquit-ignore

v0.2.2

Published

Acquit plugin for removing lines of code from output

Readme

acquit-ignore

Acquit plugin for removing lines of code from output

Build Status Coverage Status

It removes code between delimiters

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);

It supports custom delimiters

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);

It can accept an acquit instance

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);

Can remove indent that changes between ignore comments

Can remove indent that changed between the start and end comments, to allow smoother flow:

const acquit = require('acquit');
require('acquit-ignore')();

var contents = [
  'describe(\'test\', function() {',
  '  it(\'works\', function(done) {',
  '    // acquit:ignore:start',
  '    const t = 1',
  '    // acquit:ignore:end',
  '    const a = 2',
  '    // acquit:ignore:start',
  '    setTimeout(function() {',
  '      // acquit:ignore:end',
  '      something.save()',
  '      // acquit:ignore:start',
  '      t.cb(() => {',
  '        // acquit:ignore:end',
  '        other.save()',
  '        // acquit:ignore:start',
  '      })',
  '      // acquit:ignore:end',
  '      s.cb(() => {',
  '        another.save()',
  '      })',
  '      // acquit:ignore:start',
  '    }, 0);',
  '    // acquit:ignore:end',
  '  });',
  '});'
].join('\n');

const blocks = acquit.parse(contents);
assert.equal(blocks.length, 1);
assert.equal(blocks[0].blocks[0].contents, 'works');

const expectedCode = [
  'const a = 2',
  'something.save()',
  'other.save()',
  's.cb(() => {',
  '  another.save()',
  '})'
].join('\n');

assert.equal(blocks[0].blocks[0].code, expectedCode);

Also if option getIndentDifferenceFromNextLine is true (which is the default), then the indent will also be gotten from the next line after the end comment:

const acquit = require('acquit');
require('acquit-ignore')({
  getIndentDifferenceFromNextLine: true
});

var contents = [
  'describe(\'test\', function() {',
  '  it(\'works\', function(done) {',
  '    // acquit:ignore:start',
  '    const t = 1',
  '    // acquit:ignore:end',
  '    const a = 2',
  '    // acquit:ignore:start',
  '    setTimeout(function() {',
  '    // acquit:ignore:end', // should get the indent from the next line
  '      something.save()', // should get indent from here
  '      // acquit:ignore:start',
  '      t.cb(() => {',
  '      // acquit:ignore:end', // should get the indent from the next line
  '        other.save()', // should get indent from here
  '        // acquit:ignore:start',
  '      })',
  '      // acquit:ignore:end',
  '      s.cb(() => {',
  '        another.save()',
  '      })',
  '      // acquit:ignore:start',
  '    }, 0);',
  '    // acquit:ignore:end',
  '  });',
  '});'
].join('\n');

const blocks = acquit.parse(contents);
assert.equal(blocks.length, 1);
assert.equal(blocks[0].blocks[0].contents, 'works');

const expectedCode = [
  'const a = 2',
  'something.save()',
  'other.save()',
  's.cb(() => {',
  '  another.save()',
  '})'
].join('\n');

assert.equal(blocks[0].blocks[0].code, expectedCode);

Also supports a "ignore-next-line"

Like eslint's eslint-disable-next-line, this package also supports a similar method:

const acquit = require('acquit');
require('acquit-ignore')();

var contents = [
  'describe(\'test\', function() {',
  '  it(\'works\', function(done) {',
  '    // acquit:ignore-next-line',
  '    const t = 1',
  '    const a = 2',
  '    // acquit:ignore-next-line',
  '    setTimeout(function() {',
  '      something.save()',
  '      // acquit:ignore-next-line',
  '      t.cb(() => {',
  '        other.save()',
  '        // acquit:ignore-next-line',
  '      })',
  '      s.cb(() => {',
  '        another.save()',
  '      })',
  '      // acquit:ignore-next-line',
  '    }, 0);',
  '  });',
  '});'
].join('\n');

const blocks = acquit.parse(contents);
assert.equal(blocks.length, 1);
assert.equal(blocks[0].blocks[0].contents, 'works');

const expectedCode = [
  'const a = 2',
  'something.save()',
  'other.save()',
  's.cb(() => {',
  '  another.save()',
  '})'
].join('\n');

assert.equal(blocks[0].blocks[0].code, expectedCode);