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

mouette

v0.2.1

Published

A linter for your MongoDB.

Downloads

4

Readme

Mouette

Mouette is a linter for your MongoDB.

Try it out

yarn global add mouette
mouette lint --summary mongodb://...
mouette lint mongodb://...

To see all functions, run mouette --help

Rules

  • [X] Collection names camel/snake case: Make sure all collection names in the database have the right case.
    • case: The case your collection names should be in.
  • [X] Collection names singular/plural: Make sure all collections in the database have names that are either singular or plural.
    • number: The grammatical number that collection names should be checked for.
  • [X] Key names singular/plural: Make sure all keys in the database have the right case.
    • case: The case your keys should be in.
  • [X] Keys that end in At should refer to dates: Make sure columns with keys that end in ...At contain nothing but dates.
    • allow-stringified-days: Whether to allow dates that are saved as strings.
    • stringified-days-regex: The regexp used to determine whether a string contains a date.
  • [X] Max key count: Enforces a maximum number of keys per collection.
    • maximum-excluding-_id: The maximum number of keys allowed.
  • [X] No bad key names: Make sure no common bad key names are used.
    • names-considered-bad: Key names that should be avoided.
  • [X] No dates saved as string: Makes sure dates don't get saved as strings.
  • [X] No leading underscores in key names: Make sure no key name except _id starts with an underscore.
  • [X] No mixed types: Makes sure columns contain values of no more than one type.
  • [ ] No null: Make sure columns do not contain null values.
  • [X] No numbers saved as string: Makes sure numbers don't get saved as strings.
    • strict-number-check: When this is set to true, strings like '015', '0xF' or '0b1111 are ignored.
  • [ ] No undefined: Make sure columns do not contain undefined values.
  • [X] Question keys should refer to booleans: Make sure columns with keys that start with verbs like "is" or "has" contain nothing but booleans.
    • boolean-key-prefixes: Which prefixes should indicate booleans.

Features

  • Completely schemaless, mouette needs no information about your db to run.
  • Suggests fixes when possible
  • Prints queries ready to be pasted into the MongoDB shell that print all the documents that need fixing
  • Includes a diffing function that can be used to find all rule violations that were added since your last lint

Develop

git clone https://github.com/jsoendermann/mouette/
cd mouette
yarn
npm run watch
node dist/bin/mouette.js lint <your mongodb://...>

Add a new rule

  1. Copy src/rules/_RULE_TEMPLATE.ts to a new file in the src/rules/ folder.
  2. Follow the instructions in that file to implement your rule.
  3. Add default options for your new rule to defaultConfig.toml.
  4. Write tests and add them to the __tests__/rules/ folder.
  5. Send me a pull request and share your new rule with the world.