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

merlin.js

v1.4.0

Published

A javascript library to interface with the Merlin Search API

Readme

Merlin JavaScript Library

This is the JavaScript library for Merlin Search.

Installation

node (also browserify/webpack compatible)

npm install merlin.js
var Blackbird = require('merlin.js');

Browser

<script src="merlin.browser.min.js"></script>

Usage

For usage examples, see the Search API documentation.

var engine = Blackbird.engine({
    company: 'company_name',
    environment: 'environment_name', 
    instance: 'instance_name'
});

// promise style API
engine.search({ q: 'dress' })
.then(function (res) { 
    console.log(res.body.results.numfound);
})
.catch(function (err) {
    console.error('Oh no!');
});

Fallback

Fallback handles requests that fail for a given reason, such as CORS being disabled by a firewall. Currently the only supported fallback mode is proxy.

Pass the following in as a fallback in the Blackbird.engine call to enable falling back to a proxy. Note that fallback is only enabled when using merlin.js in a client environment (browser).

    fallback: {
        mode: 'proxy',
        url: 'http://your_proxy.com' // will fallback to this URL if requests fail
    }

Enabling falling back to a proxy will make it so the engine does the following:

  1. Make a request (eg. https://search.blackbird.am/company_name.environment_name.instance_name?q=dress)
  2. If request or response is rejected, prepend proxy url to request URL (http://your_proxy.com/https://search.blackbird.am/company_name.environment_name.instance_name?q=dress) and make a request.
  3. Set it so that the engine uses the proxy going forward (for that session).

Development

Clone the repo, then run the following:

cd merlin.js
npm install

Build

Building compiles the webpacked files into dist/

npm run build

Running the tests (mocha)

npm test

Documentation