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

daspec

v1.1.0

Published

Official DaSpec package for the console runner executing specs using Node.js

Downloads

8

Readme

"It's in da spec!"

DaSpec console runner for Node.js

What is DaSpec?

DaSpec is an automation framework for Executable Specifications in Markdown. It can help you:

  • Share information about planned features with non-technical stakeholders easily, and get actionable unambiguous feedback from them
  • Ensure and document shared understanding of the planned software, making the definition of done stronger and more objective
  • Document software features and APIs in a way that is easy to understand and maintain, so you can reduce the bus factor of your team and onboard new team members easily
  • Make any kind of automated tests readable to non-technical team members and stakeholders

DaSpec helps teams achieve those benefits by validating human-readable documents against a piece of software. This makes it easy to argue if the software really does what the document claims, and also quickly points out to places in your documentation that need to be updated. Because of that, DaSpec can support you in moving from confidence-based to evidence-based acceptance testing, and creating a living documentation system to remove knowledge bottlenecks.

DaSpec's primary target are teams practising Behaviour Driven Development, Specification by Example, ATDD and generally running short, frequent delivery cycles with a heavy dependency on test automation. It can, however, be useful to anyone looking to reduce the cost of discovering outdated information in documentation and tests.

Installation

You can run DaSpec directly from the console, as a standalone utility, or you can integrate it using NPM scripts.

Console runner

Install daspec globally:

npm install daspec -g

You can now run daspec in the console:

daspec --specs ...  --steps ... --output-dir ... [--sources ...] [--formatters ...]

For a list of supported options, run daspec --help or see the DaSpec Command Usage Page. You can also save the default configuration options into a file called daspec.json in the working directory, and run daspec without arguments.

NPM script

Install daspec to your project repository

npm install daspec --save-dev

Create a config file pointing daspec to your specs and step files. For a list of supported options, see the DaSpec Command Usage Page. Each command line argument corresponds to the configuration key of the same name, just without the -- prefix. For example:

{
	"specs": ["specs/*.md"],
	"steps": ["steps/**/*.js"],
	"sources": ["src/**/*.js"],
	"output-dir": "daspec-output"
}

Add a NPM test script using daspec to package.json, pointing to your config file:

"scripts": {
  "test": "daspec --config config-path.json"
},

Alternatively, save the config file as daspec.json in your project root, and you won't have to supply the --config argument. Now run:

npm test

DaSpec will execute the tests, printing the results to the console, and saving the resulting files to the output dir specified in the config file (in the previous example, daspec-output).

For en example, see the daspec-js-npm-example repository on GitHub.

Continuous integration

Both the console tool and the NPM script set-up will report a non-zero exit code in case of any failures or exceptions during processing. This means that you can use those scripts straight away in a continuous integration setup. However, it's a good idea to change the standard list of formatters to something more easily machine consumable. See the Installation Guide for more information about this.

The JUnit XML formatter produces an output that can be consumed by most continuous integration servers.

Support