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

norme

v1.0.1

Published

Opinionated JavaScript linter

Downloads

13

Readme

norme

Opinionated JavaScript linter

NPM version Linux and OS X build status Windows build status Code coverage Code style

Norme is an ESLint based JavaScript linter with lowly-configurable opinionated rules. It does not pretend to be the one style to rule them all. We all have different ideals when it comes to writing code, that linter enforces one of them:

  • 2 spaces indentations
  • no semicolon
  • dangling comma
  • support for ES.next, Node.js, React, Electron
  • ensure the requires and imports can be resolved
  • and more...

Install

$ npm install --save-dev norme

Usage

Project-wide

Using the above command will install Norme locally to your project, this is the recommended way to use it. The version should be fixed in the devDependencies so that your build don't break if the rules evolve. It can be accessed from the scripts in package.json.

{
  "scripts": {
    "test": "norme"
  },
  "devDependencies": {
    "norme": "1.0.0"
  }
}

System-wide

Installing this package with npm install --global norme will expose a binary allowing you to lint code from the command line. See the CLI documentation for more information.

It exits with code 0 when there are no errors:

$ norme lib

$ echo $?
0

It exits with the number of errors (warnings are not counted) otherwise:

$ norme test/fixtures/ko_parsingerror

/Users/ab/Workspace/OpenSource/node/norme/test/fixtures/ko_parsingerror
  1:12  error  Parsing error: Unexpected token }

✖ 1 problem (1 error, 0 warnings)

$ echo $?
1

Documentation

CLI

Usage: norme [options] [file ...]

Options:
  --eslintrc     Whether the ESLint configuration files should be read
                                                      [boolean] [default: false]
  --ext          A comma separated list of extension to search for in folders
                                                  [string] [default: ".js,.jsx"]
  -f, --format   The ESLint formatter to use
       [string] [choices: "checkstyle", "compact", "html", "jslint-xml", "json",
           "junit", "stylish", "table", "tap", "unix", "visualstudio"] [default:
                                                                      "stylish"]
  -h, --help     Print this help message and exit                      [boolean]
  -v, --version  Print version information and exit                    [boolean]

Examples:
  norme --ext=.js,.jsx,.es6 src    Support custom file extensions while linting
                                   the src folder
  norme --formatter=json src test  Specify the ESLint formatter while linting
                                   the src and test folders
  norme && ava                     Leverage the exit code to only launch ava if
                                   there are no lint errors
  norme --eslintrc                 Load the ESLint configuration files (if any)
                                   to overload the Norme rules

Notes:
  - by default, the following files will be linted: bin, lib, src, test
  - if a directory is passed, it will be recursively crawled
  - the exit code represents the number of linting errors

For more information: see https://github.com/aymericbeaumet/norme

API

Norme(files[, options])

files

Type: String[]

The files or directories to lint. If a directory is passed, it will be crawled and all the files matching the options.extensions will be linted.

options

Type: Object
Default: {}

options.cwd

Type: String
Default: process.cwd()

The root directory from which the files should be resolved from.

options.extensions

Type: String[]
Default: [ '.js', 'jsx' ]

The extensions to search for when directories are provided.

options.useEslintrc

Type: Boolean
Default: false

Whether the ESLint configuration files can override the Norme rules.

Package.json

It is possible to define a configuration in the norme key of package.json. All the options you could pass to the Norme constructor (see API documentation) can be placed here. Note that it has a lower precedence than the CLI, allowing to override options via the command line.

{
  "norme": {
    "extensions": [ ".js", ".jsx", ".es6" ]
  }
}

FAQ

Can I integrate Norme with my IDE?

Sure, just grab an ESLint plugin for your IDE and create the following .eslintrc.js in your project root:

module.exports = require('norme').rc()

How can I show my support?

Add the following badge to your project:

Code style

[![Code style](https://img.shields.io/badge/code--style-norme-brightgreen.svg?style=flat-square)](https://github.com/aymericbeaumet/norme)

Where does that name come from?

Norme is the french word for norm. It has the same pronunciation.

Support