registry
lint-staged
registry | lint-staged | |
---|---|---|
7 | 50 | |
432 | 12,885 | |
1.2% | 0.9% | |
2.5 | 8.2 | |
7 days ago | 4 days ago | |
JavaScript | ||
- | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
registry
-
Social engineering campaign targeting tech employees spreads through NPM malware
More important than the namespace is who published the package. I'm more inclined to trust an individual I know who takes security than a namespace that may change hands.
NPM exposes that info in the _npmUser field: https://github.com/npm/registry/blob/master/docs/REGISTRY-AP.... That gives "name" (NPM username) and email.
While there are thousands of packages, I bet there's a much smaller number of publishers to worry about.
-
query all npmjs packages
I can't find anything about it in their docs. https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md
-
When to use a separate backend?
https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md here are the docs. I was getting 122ms responses instead of 9000 on the old one.
-
A technical tale of NodeSecure - Chapter 1
My first instinct was to work with the public API of the npm registry. This sounds like a very good idea, but you will soon run into a set of problems (cache, private registry etc..).
-
Next.js, Material UI, MongoDB Personal Dashboard
There is no need to obtain an API key or token for querying NPM registry API. For the dashboard, I use only the endpoint that provides the data about a package downloads count - https://api.npmjs.org/downloads/. You can read more about it here.
-
Exploring the npm registry API
While many people regularly use npm's website to discover packages, only a few know that npm also provides a public REST API accessible at registry.npmjs.org.
-
[AskJS] Is there any website that regularly published npm download charts?
Or roll your own, docs here: https://github.com/npm/registry/blob/master/docs/download-counts.md
lint-staged
-
How Automation Saved Me from Oops Moments: Never Skip Tests in Production Again!
We were already using lint-staged and have a pre-commit hook in place using Husky in our project for linter and prettier. So it made sense to add a check here.
-
Pre-commit with husky & lint-staged
Now you can config it in your package.json, here is the guide doc:
-
Automating code patterns with Husky
In the world of software development, maintaining consistent code quality and ensuring that the codebase adheres to predefined patterns and guidelines is crucial. However, manually enforcing these standards can be time-consuming and error-prone. This is where automation tools like Husky, Lint-Staged, Commitlint, and Commitizen come to the rescue. In this post, we will explore how these tools can be combined to streamline your development workflow.
-
500 lines in 2013 is 10k in 2023, inflation you know
This is wasted work that can and should be automated. Adding a linter and formatter on CI and a pre-commit hook such as lint-staged can do wonders.
-
Set up linting and formatting for code and (S)CSS files in a Next.js project
lint-staged is a package that can be used to run formatting and linting commands on staged files in a Git repo.
-
How do you handle eslint/prettier configs across multiple repos?
To answer your next question: I lint and format on save, and I use Git hooks installed by Husky and executed through Lint-Staged (this tool helps ensure your Git hooks only run on modified files, etc) to ensure there are no lint or formatting errors whenever making a commit or pushing code. This is helpful for teams, as some developers tend to forget to run lint tasks, or don't have the Prettier extension installed in their IDE. If there are lint errors, the commit is rejected until fixed. YMMV - you'll need to fine-tune the strictness of this based on the team's needs.
-
How to create and publish a TypeScript library with ease
Uses Husky Git hooks and Lint-staged pre-commit hooks.
-
How to Contribute on the First Day of a Frontend Project
Something else to consider is applying linting and formatting before every git commit. A package like Lint-staged only lints and formats on staged items, ensuring all pushed code follows the standards in the repo. This allows developers to have their own formatting preferences when developing, while the code homogenizes on push. Linting pre-commit also avoids strict rules like no-console or no-unused-vars restricting a developer when writing code, when it should only apply in production. Imagine not being able to console log anything during development!
-
Commit Like a PRO
Lint-Staged Docs
-
How to beautify your code and make contributions easy?
Additionally, there are pre-commit hooks which can be setup to seamlessly validate and modify the source code before every commit. I followed Prettier documentation to create one. I ran npx mrm@2 lint-staged which installed husky and lint-stagedand added a configuration to the project’s package.json. Then, I modified the commands a little and that's it.
What are some alternatives?
flags - NodeSecure security flags 🚩 (configuration and documentation)
commitlint - 📓 Lint commit messages
my-projects-dashboard - Next.js, Material UI, MongoDB Personal Dashboard with dev.to, GitHub, Twitter, and npm API integration.
Nest - A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript 🚀
conf - Simple config handling for your app or module
stylelint - A mighty CSS linter that helps you avoid errors and enforce conventions.
birdcage - Cross-platform embeddable sandboxing
prettier - Prettier is an opinionated code formatter.
Next.js - The React Framework
graphql-code-generator - A tool for generating code based on a GraphQL schema and GraphQL operations (query/mutation/subscription), with flexible support for custom plugins.
types - Typescript definitions for npm registry content
volar - âš¡ Explore high-performance tooling for Vue [Moved to: https://github.com/vuejs/language-tools]