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

daburu-js-npm

v1.0.10

Published

This is an npm template for Javascript.

Downloads

5

Readme

daburu-js-npm

This is a simple boiler-plate for an NPM module written in JavaScript. In addition to the basics required to publish the module, it also contains setup for unit testing with Mocha, Chai, and Istanbul.

After setting up your npm account and .nprmc file, run the following npm scripts:

npm install
npm publish

eslint

This project includes an .eslintrc.json file and eslint is included as a development dependency. You can lint the project manually by running the following npm script:

npm run lint

Setting up the IDE to Use tslint

If you're using WebStorm, you may need to enable eslint. You can do so by performing the following steps:

    • Hit Ctrl+Alt+2 to open Settings.
  • Under Languages and Frameworks | Javascript | Code Quality Tools | ESLint click the Enable checkbox.

Spaces, or tabs?

The eslint configuration in this project assumes the use of tabs instead of spaces. This may or may not be what you want. You can change that preference by editing the indent rule.

If you're using WebStorm, your default configuration may prefer spaces. If so, perform the following steps:

  • Hit Ctrl+Alt+2 to open Settings.
  • Under Editor | Code Style | TypeScript look at the Tabs and Indent tab.
  • Check the Use tab character box.

Running and Debugging Tests

As we mentioned above, the project includes a unit testing and code coverage frameworks. There are a number of ways to run and debug the tests.

Run the Tests with npm

You can run the test from an npm script like so:

npm run test

This will run the tests and produce a code coverage report.

Runing Tests in WebStorm

This project uses Mocha and it just so happens that WebStorm has nice support for this platform.

To run or debug a single test, you can simply right-click on a test file and run (or debug) it from the context menu.

To create a run/debug configuration for all the tests, perform these steps:

  • From the main menu, go to Run | Edit Configurations...
  • Click the Add New Configuration button (or hit Alt+Insert).
  • Select Mocha from the menu that appears.
  • The default options are typically fine, though you'll need to add a bit of information:
    • Select All in directory
    • Test directory: the path to the test directory
    • Check Include subdirectories

When you run a configuration using the Run with Coverage options, the IDE will produce a coverage report and mark up your code files coverage indicators.

Document Your Code

This project is configured with jsdoc to produce API documentation from the source code.

You can generate the documentation by itself by running the following npm script:

npm run build:doc

This script is also run as part of the normal build process.