Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

npm-restrict

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-restrict

Package that checks git user email/domain during installation

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

NPM Restrict

A package to block installation based on git user domain.

Installation

npm install npm-restrict

Usage

CommonJS

const npmRestrict = require("npm-restrict");

// Add single email or domain
npmRestrict.addBlockedEmail("example.com");

// Add multiple emails or domains
npmRestrict.addBlockedEmails(["domain1.com", "domain2.com"]);

// Check if an email is blocked
const isBlocked = npmRestrict.isEmailBlocked("user@example.com");

// Get current git email
const currentEmail = npmRestrict.getGitEmail();

// Get list of blocked emails/domains
const blockedList = npmRestrict.getBlockedEmails();

// Clear blocked list
npmRestrict.clearBlockedEmails();

ESM

import {
  addBlockedEmail,
  addBlockedEmails,
  isEmailBlocked,
  getGitEmail,
  getBlockedEmails,
  clearBlockedEmails,
} from "npm-restrict";

// Add single email or domain
addBlockedEmail("example.com");

// Add multiple emails or domains
addBlockedEmails(["domain1.com", "domain2.com"]);

// Check if an email is blocked
const isBlocked = isEmailBlocked("user@example.com");

// Get current git email
const currentEmail = getGitEmail();

// Get list of blocked emails/domains
const blockedList = getBlockedEmails();

// Clear blocked list
clearBlockedEmails();

Keywords

git

FAQs

Package last updated on 22 Nov 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