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

@enigmax/linter

v0.4.0

Published

Ciphera-style linter and security auditor for TypeScript/JavaScript, with file-hygiene, blank-line, and hardcoded-secret checks extending to Python, Rust, and Prisma, plus embedded-code extraction for Jupyter notebooks, Astro, Vue, and Svelte.

Downloads

316

Readme

@enigmax/linter

A small, fast linter and security auditor that enforces the Ciphera code style and flags hardcoded secrets. JavaScript/TypeScript is parsed with the TypeScript compiler API, so its style checks are AST-accurate rather than regex guesses; Python, Rust, and Prisma get the language-agnostic checks (file hygiene, blank-line collapsing, and secret detection) with lightweight per-language lexing so blanks inside docstrings, block comments, and multi-line strings are left alone.

Container formats - Jupyter notebooks (.ipynb), Astro (.astro), and Vue/Svelte single-file components (.vue, .svelte) - are understood structurally: the embedded code is extracted and linted as its real language, and the wrapper (JSON, HTML) is never fed to the rules. Violations are mapped back to the physical line in the original file.

It is meant to be run on demand - by a developer, by an agent as a self-check, or wired into a project's scripts/CI - not as an always-on background process.

Languages

| Language | Extensions | Rules applied | | --- | --- | --- | | TypeScript / JavaScript | .ts .tsx .mts .cts .js .jsx .mjs .cjs | all style + audit rules | | Python | .py .pyi | no-consecutive-blank-lines, file-hygiene, no-hardcoded-secrets | | Rust | .rs | no-consecutive-blank-lines, file-hygiene, no-hardcoded-secrets | | Prisma | .prisma | no-consecutive-blank-lines, file-hygiene, no-hardcoded-secrets |

The AST-based Ciphera style rules (length-sorted imports, double quotes, template literals, semicolons, URL imports) are JavaScript/TypeScript-only by design: they encode TS idioms and would misfire on other grammars (for example, Rust 'a' char literals or Python's idiomatic single quotes).

Container formats (embedded code)

| Format | Extensions | Embedded code linted as | | --- | --- | --- | | Jupyter notebook | .ipynb | each code cell as Python (markdown/raw cells and outputs ignored; non-Python kernels skipped) | | Astro | .astro | the --- frontmatter as TypeScript plus every <script> block | | Vue / Svelte | .vue .svelte | every <script> block, typed TS or JS by its lang attribute |

Only the code regions are linted - the surrounding JSON or HTML template is never checked. The file-boundary part of file-hygiene (final newline, leading/trailing blank line) is skipped for embedded fragments, since the container owns the file's physical shape; trailing whitespace inside the code is still flagged. Every violation's line number refers to the physical line in the original file.

Usage

# lint the current directory
npx @enigmax/linter

# lint specific paths
npx @enigmax/linter src test

# only the security audit, or only style
npx @enigmax/linter --audit-only
npx @enigmax/linter --style-only

# apply safe formatting fixes in place, then report what remains
npx @enigmax/linter --fix

# machine-readable output
npx @enigmax/linter --json

--fix rewrites only the mechanical formatting rules - trailing whitespace, blank lines (collapsed, with leading/trailing removed), and the final newline. The AST style rules (quotes, semicolons, imports) and the security audits are reported, never rewritten, since fixing them safely needs real judgement. Container formats (.ipynb, .astro, .vue, .svelte) are left untouched by --fix.

The bin is enigmax-lint. It exits non-zero when any error-severity violation is found (URL/CDN imports, hardcoded secrets), so it can gate a commit or CI step.

Rules

Style (Ciphera)

| Rule | What it flags | | --- | --- | | length-sorted-imports | imports not ordered by line length, shortest first | | prefer-double-quotes | single-quoted strings (where double would work) and no-interpolation template literals | | no-useless-concat | string concatenation with + that should be a template literal | | require-semicolons | statements missing a terminating semicolon - declarations (const/let/var), imports, exports, directives like "use strict", type aliases, and class fields (function/class declarations are exempt, as their body terminates them) | | no-url-imports | importing from a remote URL / CDN instead of a package name (error) | | no-consecutive-blank-lines | two or more consecutive blank lines (collapse to one); ignores blanks inside strings/templates and block comments (all languages) | | file-hygiene | trailing whitespace, missing or extra final newline, leading blank line (all languages) |

Audit (security)

| Rule | What it flags | | --- | --- | | no-hardcoded-secrets | high-signal credential patterns - AWS keys, GitHub/Slack/Google/Stripe tokens, private-key blocks, and secret/token/api_key = "..." assignments (error, all languages) |

To keep false positives low, a match is only reported when its random portion looks like a real credential: obvious placeholders (your_api_key_here, changeme, ...) and low-entropy fillers (sk-proj-000000000000, repeated characters) are ignored. Files named *example*, *sample*, *template*, *fixture*, *.test.*, and *.spec.* are exempt from the secret audit entirely.

Programmatic API

import { lintFiles, lintText } from "@enigmax/linter";

const violations = lintFiles(["src"], { categories: ["audit"] });
const inline = lintText("snippet.ts", "const x = 'a'");

Style scope

These rules encode the Ciphera conventions for new code. Per the policy, existing files should match their established style; do not reformat working code just to satisfy the linter.