Socket
Socket
Sign inDemoInstall

@rollup/pluginutils

Package Overview
Dependencies
Maintainers
4
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rollup/pluginutils

A set of utility functions commonly used by Rollup plugins


Version published
Weekly downloads
15M
decreased by-5.12%
Maintainers
4
Weekly downloads
 
Created

What is @rollup/pluginutils?

The @rollup/pluginutils package provides a suite of utility functions commonly used by Rollup plugins. These utilities help with tasks such as filtering files to be included in the bundle, creating minimatch instances, and handling module IDs.

What are @rollup/pluginutils's main functionalities?

createFilter

createFilter allows you to create a filter function that can be used to determine whether a file should be included or excluded based on the provided include and exclude patterns.

import { createFilter } from '@rollup/pluginutils';
const filter = createFilter(include, exclude);
if (filter(somePath)) {
  // Handle the file
}

dataToEsm

dataToEsm converts a JSON object to an ES module string, which can be useful for injecting configuration or other data into your bundle.

import { dataToEsm } from '@rollup/pluginutils';
const data = { foo: 'bar' };
const esModule = dataToEsm(data);
// esModule is now a string of ESM code representing the data

addExtension

addExtension ensures that a file path has the specified extension. If it already has the extension, it returns the path unchanged.

import { addExtension } from '@rollup/pluginutils';
const filename = addExtension('myfile', '.js');
// filename is now 'myfile.js'

Other packages similar to @rollup/pluginutils

Keywords

FAQs

Package last updated on 05 Jun 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