New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@types/yarnpkg__lockfile

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/yarnpkg__lockfile

TypeScript definitions for @yarnpkg/lockfile

  • 1.1.9
  • ts4.5
  • ts4.6
  • ts4.7
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • ts5.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
735K
increased by14.84%
Maintainers
1
Weekly downloads
 
Created

What is @types/yarnpkg__lockfile?

@types/yarnpkg__lockfile provides TypeScript type definitions for the yarnpkg/lockfile package, which is used to parse and stringify Yarn lockfiles. This package allows developers to work with Yarn lockfiles in a type-safe manner, ensuring that the data structures and methods used are correctly typed.

What are @types/yarnpkg__lockfile's main functionalities?

Parse Yarn Lockfile

This feature allows you to parse a Yarn lockfile into a JavaScript object. The `parse` function reads the contents of a `yarn.lock` file and converts it into a JSON object that can be easily manipulated.

const { parse } = require('@yarnpkg/lockfile');
const fs = require('fs');

const file = fs.readFileSync('./yarn.lock', 'utf8');
const json = parse(file);
console.log(json);

Stringify Yarn Lockfile

This feature allows you to convert a JavaScript object back into a Yarn lockfile format. The `stringify` function takes a JSON object representing the lockfile and converts it into a string that can be written to a `yarn.lock` file.

const { stringify } = require('@yarnpkg/lockfile');

const json = {
  'package-a@^1.0.0': {
    version: '1.0.1',
    resolved: 'https://registry.yarnpkg.com/package-a/-/package-a-1.0.1.tgz',
    integrity: 'sha512-...',
    dependencies: {
      'package-b': '^2.0.0'
    }
  }
};

const lockfile = stringify(json);
console.log(lockfile);

Other packages similar to @types/yarnpkg__lockfile

FAQs

Package last updated on 07 Nov 2023

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