npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@toolbuilder/rollup-plugin-create-pack-file

v0.1.6

Published

Rollup plugin to create a pack file and move it somewhere else for testing.

Downloads

16

Readme

Rollup-Plugin-Create-Pack-File

This Rollup plugin creates a pack file from your package, and moves it somewhere else as part of testing your package.

This plugin is used by @toolbuilder/rollup-plugin-test-tools, which tests your pack file in temporary ES, CommonJS, and Electron projects.

Installation

npm install --save-dev @toolbuilder/rollup-plugin-create-pack-file

Use

import createPackFile from '@toolbuilder/rollup-plugin-create-pack-file'

export default {
  input: 'entry-point.js',
  output: {
    // By default the plugin will use output.dir or dirname(output.file) for the output directory
    file: 'somewhere/es/entry-point.js'
    format: 'es'
  },
  plugins: [
    createPackFile({
      // if you want the packfile in another place than dirname(output.file) or output.dir,
      // specify that directory here.
      outputDir: 'somewhere'
    })
  ]
}

This plugin runs using the generateBundle hook. This lets you use the pack file when the writeBundle hook runs. The writeBundle hook runs plugins in parallel, so you can't control plugin execution order.

Options

There are a number of options. The advanced options exist for unit testing, but you might find them useful.

Basic Options:

  • rootDir - tell the plugin where the package root is located. By default, this is process.cwd().
  • outputDir - tell the plugin the output directory for the pack file. By default the plugin uses Rollup options output.dir or dirname(output.file) - whichever was specified.
  • packCommand - tell the plugin what command to use to generate the pack file. This is not run in a shell, but execa is used to parse the command. By default, this is npm pack. For example, I use pnpm instead of npm, so my packCommand option looks like pnpm pack. The plugin expects the pack file name to match npm naming conventions.

Advanced options:

  • packageJson - By default, the plugin reads package.json at rootDir to figure out the pack file name. If you want something else, provide this option an Object that has name and version attributes just like package.json does.
  • mover - Async method that moves the pack file. Signature looks like this: async (fullPackFilePath, fullTargetPackFilePath) => {}. No return value is expected. An Error should be thrown on failure. By default the plugin provides a function to move the file.
  • shellCommand - An async method that creates the pack file when given the packCommand option value. No return value is expected, an Error should be thrown on failure. By default, the plugin uses execa.command to run packCommand.

Contributing

Contributions are welcome. Please create a pull request.

I use pnpm instead of npm.

Issues

This project uses Github issues.