Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lockfile-lint

Package Overview
Dependencies
Maintainers
2
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lockfile-lint

A CLI to lint a lockfile for security policies

  • 4.7.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
60K
decreased by-51.63%
Maintainers
2
Weekly downloads
 
Created

What is lockfile-lint?

lockfile-lint is an npm package designed to validate npm/yarn/pnpm lockfiles to ensure they adhere to security and integrity policies. It helps in preventing the use of malicious or unintended dependencies by enforcing rules on the lockfile.

What are lockfile-lint's main functionalities?

Validate Allowed Hosts

This feature allows you to validate that all dependencies in the lockfile are being fetched from allowed hosts. In this example, it ensures that all dependencies are fetched from 'npmjs.com'.

const { lint } = require('lockfile-lint');

lint({
  path: './package-lock.json',
  type: 'npm',
  validateHttps: true,
  allowedHosts: ['npmjs.com']
}).then(results => {
  console.log(results);
}).catch(err => {
  console.error(err);
});

Validate Scheme

This feature ensures that all URLs in the lockfile use the HTTPS scheme, which is more secure than HTTP.

const { lint } = require('lockfile-lint');

lint({
  path: './package-lock.json',
  type: 'npm',
  validateHttps: true
}).then(results => {
  console.log(results);
}).catch(err => {
  console.error(err);
});

Validate Integrity

This feature checks that all dependencies have valid integrity hashes, ensuring that the contents have not been tampered with.

const { lint } = require('lockfile-lint');

lint({
  path: './package-lock.json',
  type: 'npm',
  validateIntegrity: true
}).then(results => {
  console.log(results);
}).catch(err => {
  console.error(err);
});

Other packages similar to lockfile-lint

Keywords

FAQs

Package last updated on 13 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc