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 🙏

© 2025 – Pkg Stats / Ryan Hefner

satisfy

v0.1.0

Published

Readme

satisfy.js

Satisfy is a minimalistic browser testing utility designed to work with any test framework, oriented only around CSS selectors, designed for speed both of test writing and test execution.

For development, run the tests in a headless WebKit browser. For deployments, run them in the cloud in all browsers with Selenium.

It's the expect.js of browser / acceptance testing.

How to use

satisfy('localhost')
  .click('li#home a')
  .expect('h1:contains(Home)')
  .click('li#test a')
  .expect('h1:contains(Test)')

Mocha

With the mocha test framework:

var satisfy = require('satisfy');

describe('learnboost homepage', function () {
  it('should work', function (done) {
    satisfy('http://learnboost.com')
      .expect('a:contains(For Schools)')
      .run(done)
  });
});

Then run it:

$ mocha -t 0 test.js

Features

  • Fast. The default adaptor is the fastest available.
  • Test-framework agnostic, but best with the wonderful mocha
  • No APIs to learn. Only based on CSS selectors.
  • Extended CSS selectors thanks to Sizzle like :contains for text matching.
  • Adaptor based
    • webkit-server (headless webkit)
    • soda (selenium)

Examples

Following a link

satisfy('localhost')
  .click('li#home a')
  .expect('h1:contains(Home)')

Filling a form

satisfy('localhost')
  .click('#add-classroom')
  .expect('#add-classroom-dialog', 7000) // override expect timeout
  .fill('input[name=classroom-name]', 'My classroom')
  .fill({ 'textarea': 'Something' })
  .click('#add-classroom input[type=submit]')
  .expect('body:not(#add-classroom)')

Options

You can pass options to specific satisfy instances:

satisfy('http://host.com:port/path', { options })
  • adaptor String
    • webkit-server or soda (selenium/sauce labs).
    • Defaults to webkit-server
  • timeout Number
    • Timeout after which we considered the test failed if a CSS selector expectation is not met.
    • Strings like '2m' or '10s' are supported.
    • Defaults to 10000
  • webkit-server Object
    • Hash of options for the webkit-server adaptor.
    • Options
    • poll Number|String
      • How often we poll the DOM for a certain selector match.
      • Only applies for the webkit-server mode.
      • Strings like '2m' or '10s' are supported.
      • Defaults to 50
  • soda Object
    • Hash of options for the soda adaptor.
    • Options
      • sauce Boolean
        • Whether to use sauce labs.
        • Defaults to false
      • host String
        • Selenium host.
        • Defaults to localhost
      • port Number
        • Selenium port
        • Defaults to 4444
      • browser String
        • Browser to test on.
        • Defaults to firefox.
  • autorun Boolean
    • If run is not called, it calls it automatically for you
    • Defaults to true

Global options

If you wanted to pass options to all instances, you can implement that in userland easily by defining your own helper method:

function mytest (url) {
  return satisfy(url, { default options });
}