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

nutra

v0.0.14

Published

The "nutra" module is a simple, extendable unit test runner for node.

Downloads

17

Readme

N.U.T.R.A — Node Unit Test Runner Auxiliary

npm version Coverage Status Build Status Dependency Status devDependency Status

The "nutra" module is a simple, extendable unit test runner for node.

Quickstart

Get the "nutra" module up and running with just a few steps.

1) Install Nutra:
npm install --save-dev nutra

Nutra recommends Node v4+, as lower versions of node are not being officially supported.

2) Install Preset:

Give this one a try, for now. Nutra requires presets to be installed with NPM v3+ do to its reliance on a flat dependency tree.

3) Add Nutra to NPM Scripts:
{ // package.json
  ...
  "scripts": {
    "test": "nutra --config ./nutra.config.js",
  }
  ...
}
4) Run CLI:
npm run test

Support

Questions About Usage:

For questions about usage (i.e. configuration, plugin development, etc), please post them on StackOverflow and tag it with the keyword "nutra".

Issues:

For bugs and other unexpected behavior, please post them up on the issue section of this GitHub.

Usage:

CLI:

Provide a nutra configuration file: nutra --config "path/to/nutra.config.js" The "--config" argument is required Path is relative to the current working directory (cwd).

JS API:
const nutra = Nutra({
  configFile: 'path/to/nutra.config.js', // optional
  files: ['test/specs/**/*.js', 'src/**/*.js']
})
nutra.start()

The "config" argument is required. Config path is relative to the current working directory (cwd).

Configuration Presets:

Configuration Anatomy:

// nutra.config.js
module.exports = function( config ) {
  config.set({

    // The "files" property allows you to specify the location of your app files and specs.
    // It expects an array of globs (https://github.com/isaacs/node-glob) and is always required.
    files: ['test/specs/**/*.js', 'src/**/*.js'],

    // The "absolutePaths" boolean property allows you to specify whether or not all file paths
    // should be treated as absolute. This includes the preprocessor patterns.
    absolutePaths: false,

    // The "frameworks" property allows you to specify nutra framework plugins, this will typically
    // be your test framework (i.e. jasmine, mocha, etc).
    frameworks: ['nutra-jasmine'],

    // The "preprocessors" property allows you to specify nutra preprocessors plugins, this will
    // typically be coverage or transpiling tools (i.e. babel, traceur, typescript, etc).
    preprocessors: {
      'test/specs/**/*.js': ['nutra-babel'],
      'src/**/*.js': ['nutra-babel', 'nutra-coverage']
    },

    // The "reporters" property allows you to specify nutra reporters plugins, this will
    // typically be coverage and other reporting tools.
    reporters: ['nutra-coverage'],

    // The "{{plugin}}Options" property allows you to specify nutra plugin options, this will
    // vary depending on what plugins you are using. An option property for each plugin must
    // be specified (i.e. babelOptions: {}, coverageOptions: {}, etc), but it is not required.
    coverageOptions: {
      dir : './coverage/',
      reporters: [
        { type: 'lcovonly', subdir: '.', file: 'lcov.info' }
      ]
    }
  })
}

Nutra Plugins:

Contributing

Pull requests are always welcome. In lieu of a formal styleguide, please:

  • Take care to maintain the existing coding style.
  • Add unit tests for any new or changed functionality.

Why?

I get a trill from reinventing a simpler, more efficient wheel.