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 🙏

© 2024 – Pkg Stats / Ryan Hefner

interpreted

v1.0.2

Published

node-tap wrapper for testing input/output functionality

Downloads

57

Readme

interpreted

node-tap wrapper for testing input/output functionality

Installation

npm install interpreted

Documentation

var interpreted = require("interpreted");

interpreted({
  // required. full path to the source file directory and the expected directory
  // the expected directory should contain JSON files (e.q. example.json)
  // and the source directory can contain anything. Note that the basename
  // must exist in both source and expected directroy.
  // (e.q yaml to json converter: source/example.yaml, expected/example.json)
  source: path.resolve(__dirname, "source"),
  expected: path.resolve(__dirname, "expected"),

  // optional. the basenames of the files to use in tests. If this is not specified
  // all tests will be used.
  run: ["example"],

  // optional, update flag. Instead of testing expected files, they will be overwritten with
  // the actual value. Default: false
  update: false,

  // optional, read source file flag. If true the source file is read and passed
  // as a second argument to the test function. Default: true
  sourceRead: true,

  // optional. This method will execute before the file tests.
  start: function (callback) {
    callback(null);
  },

  // required. This method will be used to test the files. Note that there
  // must be passed a JSON valid value to the callback.
  test: function (name, content, callback) {
    callback(null, YAML.parse(content)); // real object (e. q. { test: true })
  },

  // optional. This method will execute after the file tests.
  close: function (callback) {
    callback(null);
  },

  // optional. This configuration object will be passed to the tap.test
  // function.
  tap: {
    timeout: 3000,
  },

  // optional: by default json files are parsed and everything else is threaded
  // as a simple text. You can extend this behaviour.
  types: {
    yaml: {
      test: function (t, actual, expected) {
        t.deepEqual(actual, YAML.parse(expected));
      },
      update: function (actual) {
        return YAML.stringify(actual);
      },
    },
  },
});