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

precinct

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

precinct

Unleash the detectives

  • 7.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
581K
decreased by-56.89%
Maintainers
1
Weekly downloads
 
Created

What is precinct?

The precinct npm package is used to find dependencies in JavaScript and other file types. It helps in identifying the modules that a given file depends on, which can be useful for various tasks such as dependency analysis, bundling, and more.

What are precinct's main functionalities?

JavaScript Dependency Detection

This feature allows you to detect dependencies in JavaScript files. By passing the content of a JavaScript file to the precinct function, it returns an array of dependencies.

const precinct = require('precinct');
const content = 'const foo = require("foo");';
const dependencies = precinct(content);
console.log(dependencies); // ['foo']

CSS Dependency Detection

This feature allows you to detect dependencies in CSS files. By specifying the type as 'css', precinct can parse and return the dependencies in CSS files.

const precinct = require('precinct');
const content = '@import "foo.css";';
const dependencies = precinct(content, { type: 'css' });
console.log(dependencies); // ['foo.css']

TypeScript Dependency Detection

This feature allows you to detect dependencies in TypeScript files. By specifying the type as 'ts', precinct can parse and return the dependencies in TypeScript files.

const precinct = require('precinct');
const content = 'import foo from "foo";';
const dependencies = precinct(content, { type: 'ts' });
console.log(dependencies); // ['foo']

Other packages similar to precinct

Keywords

FAQs

Package last updated on 16 Dec 2020

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