Skip to content

Instantly share code, notes, and snippets.

@mattdesl
Last active August 29, 2015 14:20
Show Gist options
  • Save mattdesl/dee4ad98e3c8216235c3 to your computer and use it in GitHub Desktop.
Save mattdesl/dee4ad98e3c8216235c3 to your computer and use it in GitHub Desktop.
scoped packages tip

Typical process:

  • fork a repo
  • make your patch
  • send PR

Sometimes its a long wait, and in the mean time you end up depending on Git (bad for semver/persistence, slow installs, etc).

public scoped packages

Alternatively, publish a scoped package until the original package catches up.

Branch off your PR, then rename the package name and bump semver accordingly.

{
  "name": "@mattdesl/browser-unpack",
  "version": "1.0.3",
  ...
}

Commit your changes and publish the scoped package:

npm publish --access=public

Now, in your app:

npm install @mattdesl/browser-unpack --save

And then:

var unpack = require('@mattdesl/browser-unpack')

(Maybe source transforms could transparently add scope to flagged modules to avoid having to change your codebase.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment