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

nof5

v0.4.0

Published

A tool which runs unit tests if a file has changed on the server in a browser

Downloads

16

Readme

nof5

is a server that runs Unit Tests with the help of test-suites like

on any number of mobile or desktop browsers simultaneously and automatically. nof5 is independent of these test suites and can be used with any suite. Therefore is should be simple to integrate nof5 with existing tests. nof5 is based on

It also supports Web-Bundlers such as

and can be customized to one's own needs with the help of Hooks as

  • before
  • beforeEach

Additionally nof5 supports the xUnit format and can therefore be integrated in Continuous Integration servers such as

Motivation

We originally built nof5 for our client-and server-side framework [alamid.js] (http://alamidjs.com/). [alamid.js] (http://alamidjs.com/) makes it possible that the client code can be written exactly as for the server. We use for the classes of [alamid.js] (http://alamidjs.com/) our JavaScript compiler [nodeclass] (https://npmjs.org/package/nodeclass) and the client-side code will be bundled with the help of [WebPack] (https://github.com/webpack/webpack). We also develop alamid.js using Contiuous integration and Jenkins. There was no tool that combines all these technologies.

Installation

npm install -g nof5

Options

Usage: nof5 [options]

-h, --help            output usage information
-V, --version         output the version number
-d, --debug           outputs some additional debug output, such as a list of watched folders
-s, --silent          run without console logging
--list                lists all bundler names
-p, --port <n>        server port. Default: 11234
-t, --test <dir>      path to test folder. Default: process.cwd()
-l, --lib <dir>       path to lib folder
-a, --assets <dir>    path to folder where additionally files should be also served as statics
-b, --bundler <name>  defines the bundler which should be used. Default: 'Webpack'
-H, --hooks <file>    path to file with hooks
-W, --wphooks <file>  path to file with hooks for webpack-bundler
-B, --bhooks <file>   path to file with hooks for browserify-bundler
-x, --xunit <dir>     path to store xunit.xml file.
-c, --clients <file>  use given client hook

How to use

start nof5

Just execute on command line from test's root folder nof5 or from anywhere nof5 -t path/to/test/folder

hooks

define general hooks (optional)

Define a file named nof5.hooks.js under test's root folder or pass the path to the hooks-file nof5 -H path/to/hooks/file

The hooks-file should look like this:


    exports.before = function beforeHook() {
       //will be executed once
    }

    exports.beforeEach = function() {
       //will be executed each time
    }

define webpack hooks (optional)

Define a file named nof5.webpack.hooks.js under test's root folder or or pass the path to the webpack-hooks-file nof5 -W path/to/webpack/hooks/file

The webpack-hooks.file should look like this:


    exports.use = function () {

        return {
            // webpack-options @see https://github.com/webpack/webpack#options
        };

    }

define browserify hooks (optional)

Define a file named nof5.browserify.hooks.js under test's root folder or or pass the path to the browserify-hooks-file nof5 -B path/to/browserify/hooks/file

The webpack-hooks.file should look like this:


    exports.use = function () {

        "middlewareA": function () {
            //@see https://github.com/substack/node-browserify/blob/master/doc/methods.markdown#busefn
        },

        "middlewareB": function () {
            // ...
        }
    }

Create a Test-Runner

All files under root-folder are served as static files by nof5, so you can use any assets you like, e.g. jQuery, QUnit or Mocha.


     <!-- include socket.io to notify the client that a change on files has occured -->
     <script type="text/javascript" src="/socket.io/socket.io.js"></script>

     <!-- include nof5 which will create a socket and configure it -->
     <script type="text/javascript" src="/nof5.js"></script>

     <!-- load the tests. NOTE: You must execute the tests manually with nof5.enableTests()-->
     <script type="text/javascript" src="tests.js"></script>

     <script>//configure your test-runner</script>

     <script>nof5.enableTests()</script>

See also the example implementation of a Test-Runner.

Use with Jenkins

TODO