
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
npm-restrict
Advanced tools
A package to block installation based on git user domain.
npm install npm-restrict
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();
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();
FAQs
Package that checks git user email/domain during installation
We found that npm-restrict demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.