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

octokit-auth-netrc

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

octokit-auth-netrc

netrc auth plugin for Octokit

  • 3.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.3K
decreased by-81.81%
Maintainers
1
Weekly downloads
 
Created
Source

octokit-auth-netrc

.netrc auth plugin for Octokit

Codecov Node CI Workflow Status OpenSSF Scorecard SLSA Level 2

Table of Contents

Usage

MIT license npm Try octokit-auth-netrc on RunKit node

Installation

$ npm install octokit-auth-netrc --save-prod

Defining your token

Add a personal access token to your ~/.netrc file

machine api.github.com
  login <personal access token here>

machine github.acme-inc.com
  login <personal access token here>

Example

Import
import {createNetrcAuth} from './lib/index.cjs';
Authenticate
/*defaults to api.github.com*/
const auth = createNetrcAuth();

/*For use with GHES, override the default domain*/
const enterpriseAuth = createNetrcAuth({ domain: 'github.acme-inc.com' });

(async () => {
  await auth();
  await enterpriseAuth();
})();

API

createNetrcAuth

Returns an auth() function after reading your token from the ~/.netrc file. Throws an error with code ENONETRCTOKEN when an entry for api.github.com is not found in the ~/.netrc file.

Contributing

PRs Welcome Conventional Commits Commitizen friendly semantic-release Renovate

Dependencies

$ nvm install
$ npm install

Verification

$ NODE_OPTIONS=--no-experimental-fetch npm test

FAQs

Package last updated on 12 Jul 2024

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