Skip to content
Branch: master
Find file History

Latest commit

larixer and arcanis Adds support for setting compression level on produced zip archives (#…

* Adds support for setting compression level on archives

* Updatte versions

* Remove unused function

* Map default compression level to 6

* Use "mixed" as default

Co-authored-by: Maël Nison <>
Latest commit 05d93b3 Apr 2, 2020


Type Name Latest commit message Commit time
Failed to load latest commit information.
bin/@yarnpkg Releasing 21 new packages Mar 12, 2020
sources Adds support for setting compression level on produced zip archives (#… Apr 2, 2020
package.json Releasing 11 new packages Mar 25, 2020


This plugin will add support to Yarn for the exec: protocol. This protocol is special in that it'll instruct Yarn to execute the specified Node script and use its output as package content (thus treating the script as a kind of package factory).


yarn plugin import exec



  "dependencies": {
    "pkg": "exec:./gen-pkg.js"


const {mkdirSync, writeFileSync} = require(`fs`);
const generatorPath = process.argv[2];


writeFileSync(`${generatorPath}/build/package.json`, JSON.stringify({
  name: `pkg`,
  version: `1.0.0`,

writeFileSync(`${generatorPath}/build/index.js`, `module.exports = ${};\n`);


The script will be invoked with one parameter which is a temporary directory. You're free to do whatever you want inside, but at the end of the execution Yarn will expect a build directory to have been created inside it that will then be compressed into an archive and stored within the cache.

Busting the cache isn't currently supported - you'll need to manually remove the relevant archives from your cache each time you want to update the content of the package. Help welcome!

You can’t perform that action at this time.