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 🙏

© 2026 – Pkg Stats / Ryan Hefner

yamllint-js

v0.1.0

Published

A linter for YAML files — an unofficial native Node.js port of Python yamllint.

Downloads

541

Readme

yamllint-js

This project is an unofficial Node.js port of adrienverge/yamllint, (the upstream project) originally created by Adrien Vergé.

The original project is licensed under GPL-3.0, which also applies here.


A linter for YAML files — an unofficial native Node.js port of Python yamllint.

yamllint does not only check for syntax validity, but for weirdnesses like key repetition and cosmetic problems such as lines length, trailing spaces, indentation, etc.

CI Publish NPM version

Why

The goal of this project is to enable the use of upstream in Node.js-only environments without requiring Python, by providing a Node.js–native port that aims for 100% compatibility with the original Python implementation.

In addition, several improvements were made during the porting process to enhance the tool itself, not just its integration with Node.js:

  1. Fix a new-lines issue (https://github.com/adrienverge/yamllint/issues/475)
  2. Multiple configuration files
  3. Mitigated a ReDoS vulnerability

Documentation

[!NOTE] This package does not include standalone documentation. Instead, please consult the official yamllint (Python) documentation.

https://yamllint.readthedocs.io/

Overview

Screenshot

yamllint-js screenshot

Installation

# npm
npm install yamllint-js

# yarn
yarn add yamllint-js

# bun
bun add yamllint-js

or global installation:

npm install -g yamllint-js
yarn global install yamllint-js
bun add -g yamllint-js

Upstream is also packaged for all major operating systems, see installation examples (dnf, apt-get...) in the official yamllint (Python) documentation.

Usage

[!NOTE] yarn or bun can be used as alternatives to npx.

All node_modules directories are ignored.

# Lint one or more files
npx yamllint my_file.yml my_other_file.yaml ...
# Recursively lint all YAML files in a directory
npx yamllint .
# Use a pre-defined lint configuration
npx yamllint -d relaxed file.yaml

# Use a custom lint configuration
npx yamllint -c /path/to/myconfig file-to-lint.yaml
# Output a parsable format (for syntax checking in editors like Vim, emacs...)
npx yamllint -f parsable file.yaml

Read more in the complete official yamllint (Python) documentation!

Configuration

In addition to the upstream configuration format, JavaScript and TypeScript configuration files are also supported:

Configuration can be easily defined with type hints, like:

/** @type {import("yamllint-js").UserConfig")} */

const config = {/* ... */};

modules.exports = config;

or, with an explicit type:

import { defineConfig, type UserConfig } from "yamllint-js";

const config: UserConfig = {/* ... */};

export default defineConfig(config);

Read more in the Configuration page of the official yamllint (Python) documentation!

Features

Here is a yamllint configuration file example:

extends: default

rules:
  # 80 chars should be enough, but don't fail if a line is longer
  line-length:
    max: 80
    level: warning

  # don't bother me with this rule
  indentation: disable

Within a YAML file, special comments can be used to disable checks for a single line:

This line is waaaaaaaaaay too long  # yamllint disable-line

or for a whole block:

# yamllint disable rule:colons
- Lorem       : ipsum
  dolor       : sit amet,
  consectetur : adipiscing elit
# yamllint enable

Specific files can be ignored (totally or for some rules only) using a .gitignore-style pattern:

# For all rules
ignore: |
  *.dont-lint-me.yaml
  /bin/
  !/bin/*.lint-me-anyway.yaml

rules:
  key-duplicates:
    ignore: |
      generated
      *.template.yaml
  trailing-spaces:
    ignore: |
      *.ignore-trailing-spaces.yaml
      /ascii-art/*

Read more in the complete official yamllint (Python) documentation!

License

GPL version 3