You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

unplugin-utils

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unplugin-utils

A set of utility functions commonly used by unplugins.

0.2.5
latest
Source
npmnpm
Version published
Weekly downloads
1.2M
3.8%
Maintainers
1
Weekly downloads
 
Created
Source

unplugin-utils npm codecov

Unit Test

A set of utility functions commonly used by unplugins.

Thanks to @rollup/pluginutils. This projects is heavily copied from it.

Why Fork?

  • 🌍 Platform agnostic, supports running in the browser, Node.js...
  • ✂️ Subset, smaller bundle size.
  • 💯 Coverage: 100% test coverage.

Install

npm i unplugin-utils

Usage

createFilter

export default function myPlugin(options = {}) {
  const filter = createFilter(options.include, options.exclude)

  return {
    transform(code, id) {
      if (!filter(id)) return

      // proceed with the transformation...
    },
  }
}

normalizePath

import { normalizePath } from 'unplugin-utils'

normalizePath(String.raw`foo\bar`) // 'foo/bar'
normalizePath('foo/bar') // 'foo/bar'

Sponsors

License

MIT License © 2025 三咲智子 Kevin Deng

MIT Copyright (c) 2019 RollupJS Plugin Contributors (https://github.com/rollup/plugins/graphs/contributors)

FAQs

Package last updated on 06 Aug 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.