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

@nomadinteractive/nomad-codecheck

v1.0.37

Published

A small toolkit consists of individual rules (similar to eslint) to check quality of the codebase and commits.

Downloads

4

Readme

Nomad Code Check

A small toolkit consists of individual rules (similar to eslint) to check quality of the codebase and commits.

Installation

npm install nomad-codecheck --save-dev

Setting up rule configuration

In the target application folder (usually src or app folder), create .nomad-codecheckrc file with JSON configuration or for more flexible format (whick you can comment, add methods etc) .nomad-codecheckrc.js as a javascript module that produces and exports the config JSON object.

.nomad-codecheckrc.js example:

module.exports = {
	"rules": [
		"branch-name-lint",
		"no-assets-outside-assets-folder",
		"no-network-request-outside-network-managers-folder",
		"no-storage-outside-persistent-data-managers-folder",
	]
}

Usage

Add the nomad-codecheck app call in your scripts in package.json and use it as chain call in your pre-commit or CI commands.

"scripts": {
	"check": "nomad-codecheck ./src"
},

Now you can use it with npm run check.

Program will exit -1 if any of the rules will fail, it will print the status of each rule and the breakdown of the failed checks.

Available rules

Each rule is hardcoded and may be modified to accept a configuration object from the JSON configuration for each script's own preferences.

branch-name-lint

This rule enforces the branch naming convention to be respected.

no-assets-outside-assets-folder

This rule enforces the practice of keeping all static assets (images, videos and font files) under /assets folder inside the application folder structure. The rule will scan all other folders and will list any file that is located outside of /assets folder.

no-network-request-outside-network-managers-folder

This rule enforces the practice of keeping all network requests (api calls) to be organized under a specific folder as javascript modules under /network-managers folder inside the application folder structure. The rule will scan file contents for specific libraries (like axios, fetch...) on all folders except network-managers folder and will list any file that contains the import/require or usage of these libraries.

no-storage-outside-persistent-data-managers-folder

This rule enforces the practice of keeping all persistent storage use cases to be organized under a specific folder as javascript modules under /persistent-data-managers folder inside the application folder structure. The rule will scan file contents for specific libraries (like local-storage, async-storage, realm...) on all folders except persistent-data-managers folder and will list any file that contains the import/require or usage of these libraries.

Example use

See https://github.com/nomadinteractive/nomad-codecheck-example repository for an example app that will display the rule violations when npm run check command executed

License

MIT