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

get-pkg-repo

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-pkg-repo

Get repository url from package json data

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2M
decreased by-41.36%
Maintainers
1
Weekly downloads
 
Created

What is get-pkg-repo?

The get-pkg-repo npm package is designed to extract repository information from a package.json file. This can be useful for various tasks such as automating repository-related workflows, generating documentation, or integrating with other tools that require repository details.

What are get-pkg-repo's main functionalities?

Extract Repository URL

This feature allows you to extract the repository URL from a package.json file. The code sample demonstrates how to require the get-pkg-repo package, read the package.json file, and then extract and log the repository URL.

const getPkgRepo = require('get-pkg-repo');
const pkg = require('./package.json');
const repo = getPkgRepo(pkg);
console.log(repo.url);

Extract Repository Type

This feature allows you to extract the type of repository (e.g., git) from a package.json file. The code sample shows how to extract and log the repository type.

const getPkgRepo = require('get-pkg-repo');
const pkg = require('./package.json');
const repo = getPkgRepo(pkg);
console.log(repo.type);

Extract Repository Directory

This feature allows you to extract the directory within the repository if specified in the package.json file. The code sample demonstrates how to extract and log the repository directory.

const getPkgRepo = require('get-pkg-repo');
const pkg = require('./package.json');
const repo = getPkgRepo(pkg);
console.log(repo.directory);

Other packages similar to get-pkg-repo

Keywords

FAQs

Package last updated on 03 Feb 2016

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