<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><description>Blog about npm things.</description><title>The npm Blog</title><generator>Tumblr (3.0; @npmjs)</generator><link>http://blog.npmjs.org/</link><item><title>How we deploy at npm</title><description>&lt;p&gt;Here’s how we deploy node services at npm:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;cd ~/code/exciting-service
git push origin +master:deploy-production
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;That’s it: &lt;code&gt;git push&lt;/code&gt; and we’ve deployed.&lt;/p&gt;&lt;p&gt;Of course, a &lt;i&gt;lot&lt;/i&gt; is triggered by that simple action. This blog post is all about the things that happen &lt;i&gt;after&lt;/i&gt; we type a git command and press Return.&lt;/p&gt;&lt;figure data-orig-width="1352" data-orig-height="262" class="tmblr-full"&gt;&lt;img src="http://68.media.tumblr.com/2b2643eace6a084814cfd2c6653c2913/tumblr_inline_of92266Kte1qzzpv5_540.png" alt="image" data-orig-width="1352" data-orig-height="262"/&gt;&lt;/figure&gt;&lt;h2&gt;Goals&lt;/h2&gt;&lt;p&gt;As we worked on our system, we were motivated by a few guiding principles:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;deploying should be so easy there’s no reason not to;&lt;/li&gt;
&lt;li&gt;rolling back a push should be as easy as the original push was;&lt;/li&gt;
&lt;li&gt;our team is small: automate everything!&lt;/li&gt;
&lt;li&gt;everything a service needs to start must be on the host with it;&lt;/li&gt;
&lt;li&gt;each step is simple &amp;amp; useful on its own;&lt;/li&gt;
&lt;li&gt;everything can be run by hand (or by a Slack bot!) if necessary;&lt;/li&gt;
&lt;li&gt;every step can be run many times without harm.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Why? We want no barriers to pushing out code once it’s been tested and reviewed, and no barriers to rolling it back if something surprising happens — so any friction in the process should be present before code is merged into master, via a review process, not after we’ve decided it’s good. By separating the steps, we gain finer control over how things happen. Finally, making things repeatable means the system is more robust.&lt;/p&gt;&lt;h2&gt;Thousand-foot view&lt;/h2&gt;&lt;p&gt;What happens when you do that force-push to the &lt;code&gt;deploy-production&lt;/code&gt; branch? It starts at the moment an instance on AWS is configured for its role in life.&lt;/p&gt;&lt;p&gt;We use &lt;a href="https://www.terraform.io"&gt;Terraform&lt;/a&gt; and &lt;a href="https://www.ansible.com"&gt;Ansible&lt;/a&gt; to manage our deployed infrastructure. At the moment I’m typing, we have around 120 AWS instances of various sizes, in four different AWS regions. We use &lt;a href="https://www.packer.io"&gt;Packer&lt;/a&gt; to pre-bake an AMI based on Ubuntu Trusty with most of npm’s operational requirements, and push it out to each AWS region.&lt;/p&gt;&lt;p&gt;For example, we pre-install a recent LTS release of node as well as our monitoring system onto the AMI. This pre-bake greatly shortens the time it takes to provision a new instance. Terraform reads a configuration file describing the desired instance, creates it, adds it to any security groups needed and so on, then runs an Ansible playbook to configure it.&lt;/p&gt;&lt;p&gt;Ansible sets up which services a host is expected to run. It writes a rules file for the incoming webhooks listener, then populates the deployment scripts. It sets up a webhook on GitHub for each of the services this instance needs to run. Ansible then concludes its work by running all of the deploy scripts for the new instance once, to get its services started. After that, it can be added to the production rotation by pointing our CDN at it, or by pointing other processes to it through a configuration change.&lt;/p&gt;&lt;p&gt;This setup phase happens less often than you might think. We treat microservices instances as disposable, but most of them are quite long-lived.&lt;/p&gt;&lt;p&gt;So our new instance, configured to run its little suite of microservices, is now happily running. Suppose you then do some new development work on one of those microservices. You make a pull request to the repo in the usual way, which gets reviewed by your colleagues and tested on Travis. You’re ready to run it for real!&lt;/p&gt;&lt;p&gt;You do that force-push to &lt;code&gt;deploy-staging&lt;/code&gt;, and this is what happens: A reference gets repointed on the GitHub remote. GitHub notifies a web hooks service listening on running instances. This webhooks service compares the incoming hook payload against its configured rules, decides it has a match, &amp;amp; runs a deploy script.&lt;/p&gt;&lt;p&gt;Our deploy scripts are written in bash, and we’ve separated each step of a deploy into a separate script that can be invoked on its own. We don’t just invoke them through GitHub hooks! One of our Slack chatbots is set up to respond to commands to invoke these scripts on specific hosts. Here’s what they do:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;pull code with git &amp;amp; run npm install&lt;/li&gt;
&lt;li&gt;update configuration from our config db&lt;/li&gt;
&lt;li&gt;roll services one process at a time&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Each step reports success or failure to our company Slack so we know if a deploy went wrong, and if so at which step. We emit metrics on each step as well, so we can annotate our dashboards with deploy events.&lt;/p&gt;&lt;h2&gt;Conventions&lt;/h2&gt;&lt;p&gt;We name our deploy branches &lt;code&gt;deploy-foo&lt;/code&gt;, so we have, for instance, &lt;code&gt;deploy-staging&lt;/code&gt;, &lt;code&gt;deploy-canary&lt;/code&gt;, and &lt;code&gt;deploy-production&lt;/code&gt; branches for each repo, representing each of our deployment environments. &lt;code&gt;Staging&lt;/code&gt; is an internal development environment with a snapshot of production data but very light load and no redundancy. &lt;code&gt;Canary&lt;/code&gt; hosts are hosts in the production line that only take a small percentage of production load, enough to shake out load-related problems. And &lt;code&gt;production&lt;/code&gt; is, as you expect, the hosts that take production traffic.&lt;/p&gt;&lt;p&gt;Every host runs a haproxy, which does load balancing as well as TLS termination. We use TLS for most internal communication among services, even within a datacenter. Unless there’s a good reason for a microservice to be a singleton, there are &lt;i&gt;N&lt;/i&gt; copies of everything running on each host, where N is usually 4.&lt;/p&gt;&lt;p&gt;When we roll services, we take them out of haproxy briefly using its API, restart, then wait until they come back up again. Every service has two monitoring hooks at conventional endpoints: a low-cost ping and a higher-cost status check. The ping is tested for response before we put the service back into haproxy. A failure to come back up before a timeout stops the whole roll on that host.&lt;/p&gt;&lt;p&gt;You’ll notice that we don’t do any cross-host orchestration. If a deploy is plain bad and fails on every host, we’ll lose at most 1 process out of 4, so we’re still serving requests (though  at diminished capacity). Our Slack operational incidents channel gets a warning message when this happens, so the person who did the deploy can act immediately. This level of orchestration has been good enough thus far when combined with monitoring and reporting in Slack.&lt;/p&gt;&lt;p&gt;You’ll also notice that we’re not doing any auto-scaling or managing clusters of containers using, e.g., Kubernetes or CoreOS. We haven’t had any problems that needed to be solved with that kind of complexity yet, and in fact my major pushes over the last year have been to simplify the system rather than add more moving parts. Right now, we are more likely to add copies of services for redundancy reasons than for scaling reasons.&lt;/p&gt;&lt;h2&gt;Configuration&lt;/h2&gt;&lt;p&gt;Configuration is a perennial pain. Our current config situation is best described as “less painful than it used to be.”&lt;/p&gt;&lt;p&gt;We store all service configuration in an &lt;a href="https://github.com/coreos/etcd"&gt;etcd&lt;/a&gt; cluster. Engineers write to it with a command-line tool, then a second tool pulls from it and writes configuration at deploy time. This means config is frozen at the moment of deploy, in the upstart config. If a process crashes &amp;amp; restarts, it comes up with the same configuration as its peers. We do not have plans to read config on the fly. (Since node processes are so fast to restart, I prefer killing a process &amp;amp; restarting with known state to trying to manage all state in a long-lived process.)&lt;/p&gt;&lt;p&gt;Each service has a configuration template file that requests the config data it requires. This file is in &lt;a href="https://github.com/toml-lang/toml"&gt;TOML&lt;/a&gt; format for human readability. At deploy time the script runs &amp;amp; requests keys from etcd namespace by the config value, the service requesting the config, and the configuration group of the host. This lets us separate hosts by region or by cluster, so we can, for example, point a service at a Redis in the same AWS data center.&lt;/p&gt;&lt;p&gt;Here’s an example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&amp;gt; furthermore get /slack_token/
slack_token matches:
/slack_token == xoxb-deadbeef
/slack_token.LOUDBOT == XOXB-0DDBA11
/slack_token.hermione == xoxb-5ca1ab1e
/slack_token.korzybski == xoxb-ca11ab1e
/slack_token.slouchbot == xoxb-cafed00d
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Each of our chatbots has a different Slack API token stored in the config database, but in their config templates they need only say they require a variable named &lt;code&gt;slack_token&lt;/code&gt;[&lt;a href="#fn1"&gt;1&lt;/a&gt;].&lt;/p&gt;&lt;p&gt;These config variables are converted into environment variable specifications or command-line options in an upstart file, controlled by the configuration template. All config is baked into the upstart file and an inspection of that file tells you everything you need to know.&lt;/p&gt;&lt;p&gt;Here’s LOUDBOT’s config template:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;app = "LOUDBOT"
description = "YELL AND THEN YELL SOME MORE"
start = "node REAL_TIME_LOUDIE.js"
processes = 1

[environment]
  SERVICE_NAME = "LOUDBOT"
  SLACK_TOKEN = "{{slack_token}}"
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And the generated upstart file:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;# LOUDBOT node 0

description "YELL AND THEN YELL SOME MORE"

start on started network-services
stop on stopping network-services
respawn
setuid ubuntu
setgid ubuntu
limit nofile 1000000 1000000

script
    cd /mnt/deploys/LOUDBOT
    SERVICE_NAME="LOUDBOT" \
    SLACK_TOKEN="XOXB-0DDBA11" \
    node REAL_TIME_LOUDIE.js \
    &amp;gt;&amp;gt; logs/LOUDBOT0.log 2&amp;gt;&amp;amp;1
end script
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This situation is vulnerable to the usual mess-ups: somebody forgets to override a config option for a cluster, or to add a new config value to the production etcd as well as to the staging etcd. That said, it’s at least easily inspectable, both in the db and via the results of a config run.&lt;/p&gt;&lt;h2&gt;Open source&lt;/h2&gt;&lt;p&gt;The system I describe above is sui generis, and it’s not clear that any of the components would be useful to anybody else. But our habit as an engineering organization is to open-source all our tools by default, so everything except the bash scripts is available if you’d find it useful. In particular, &lt;code&gt;furthermore&lt;/code&gt; is handy if you work with etcd a lot.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="https://github.com/ceejbot/jthooks"&gt;jthooks&lt;/a&gt; - add and remove webhooks from a Github repo&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/ceejbot/jthoober"&gt;jthoober&lt;/a&gt; - handle incoming Github webhooks to run shell scripts&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/npm/etcetera"&gt;etcetera&lt;/a&gt; - read configuration from etcd &amp;amp; populate an upstart template&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/ceejbot/furthermore"&gt;furthermore&lt;/a&gt; - get &amp;amp; set etcd keys conveniently, with regexp searching&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;[&lt;a href="#fr1"&gt;1&lt;/a&gt;] The tokens in this post aren’t real. And, yes, LOUDBOT’s are always all-caps. &lt;/p&gt;</description><link>http://blog.npmjs.org/post/152035356435</link><guid>http://blog.npmjs.org/post/152035356435</guid><pubDate>Wed, 19 Oct 2016 12:33:04 -0700</pubDate><category>npm</category><category>npm registry</category><category>devops</category><category>etcd</category><category>deploying</category><category>bash hackery</category><category>git</category><category>extremely boring and simple</category><category>describing this before I forget all about it</category><category>demonstrating my mastery of the art of tumblr tagging</category><category>there's a bug in the reporting</category><category>that I noticed while screenshotting this</category><category>it's like 90% bash</category><dc:creator>ceejbot</dc:creator></item><item><title>Hello, Yarn!</title><description>&lt;p&gt;Today, &lt;a href="https://code.facebook.com/posts/1840075619545360"&gt;Facebook announced&lt;/a&gt; that they have open sourced &lt;a href="https://github.com/yarnpkg/yarn"&gt;Yarn&lt;/a&gt;, a backwards-compatible client for the npm registry. This joins a list of other third-party registry clients that include &lt;a href="https://www.npmjs.com/package/ied"&gt;ied&lt;/a&gt;, &lt;a href="https://www.npmjs.com/package/pnpm"&gt;pnpm&lt;/a&gt;, &lt;a href="https://www.npmjs.com/package/npm-install"&gt;npm-install&lt;/a&gt; and &lt;a href="https://www.npmjs.com/package/npmd"&gt;npmd&lt;/a&gt;. (Apologies if we missed any.) Yarn’s arrival is great news for npm&amp;rsquo;s users worldwide and we&amp;rsquo;re happy to see it.&lt;/p&gt;

&lt;p&gt;Like other third-party registry clients, Yarn takes the list of priorities that our official npm client balances, and shifts them around a little. It also solves a number of problems that Facebook was encountering using npm at their unique global scale. Yarn includes another take on npm&amp;rsquo;s shrinkwrap feature and some clever performance work. We&amp;rsquo;ve also been working on these specific features, so we&amp;rsquo;ll be paying close attention.&lt;/p&gt;

&lt;h2&gt;Does it work with npm?&lt;/h2&gt;

&lt;p&gt;Mostly! We haven’t had time to run extensive tests on the compatibility of Yarn, but it seems to work great with public packages. It does not authenticate to the registry the way the official client does, so it’s currently unable to work with private packages. The Yarn team is aware of this issue and have said they&amp;rsquo;ll address it.&lt;/p&gt;

&lt;h2&gt;Is Facebook forking the community?&lt;/h2&gt;

&lt;p&gt;Whenever a big company gets involved in an open source project, there’s some understandable anxiety from the community about its intentions.&lt;/p&gt;

&lt;p&gt;Yarn publishes to npm&amp;rsquo;s own registry by default, so Yarn users continue to be part of the existing community and benefit from the same 350,000+ packages as users of the official npm client. Yarn pulls packages from &lt;a href="http://registry.yarnpkg.com/"&gt;registry.yarnpkg.com&lt;/a&gt;, which allows them to run experiments with the Yarn client. This is a proxy that pulls packages from the official npm registry, much like &lt;a href="https://npmjs.cf/"&gt;npmjs.cf&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Like so many other companies around the world, Facebook benefits from the united open source JavaScript community on npm.&lt;/p&gt;

&lt;h2&gt;This is how open source works&lt;/h2&gt;

&lt;p&gt;As I said at the start, we&amp;rsquo;re happy to see Yarn join the ranks of open source npm clients. This is how open source software is supposed to work!&lt;/p&gt;

&lt;p&gt;The developers behind Yarn — &lt;a href="https://www.npmjs.com/~sebmck"&gt;Seb&lt;/a&gt;, &lt;a href="https://www.npmjs.com/~thejameskyle"&gt;James&lt;/a&gt;, &lt;a href="https://www.npmjs.com/~cpojer"&gt;Christoph&lt;/a&gt;, and &lt;a href="https://github.com/bestander"&gt;Konstantin&lt;/a&gt; — are prolific publishers of npm packages and pillars of the npm community.&lt;/p&gt;

&lt;p&gt;Through their efforts, Facebook and others have put a lot of developer time into this project to solve problems they encountered. Sharing the fruits of their labor will allow ideas and bugfixes to flow back and forth between npm&amp;rsquo;s official client and all the others. Everyone benefits as a result.&lt;/p&gt;

&lt;p&gt;Yarn also shows that one of the world&amp;rsquo;s largest tech companies, which is already behind hugely popular JavaScript projects like &lt;a href="https://www.npmjs.com/package/react"&gt;React&lt;/a&gt;, is invested in and committed to the ongoing health of the npm community. That&amp;rsquo;s great news for JavaScript devs everywhere.&lt;/p&gt;

&lt;p&gt;We&amp;rsquo;re pleased to see Yarn get off to such a great start, and look forward to seeing where it goes.&lt;/p&gt;</description><link>http://blog.npmjs.org/post/151660845210</link><guid>http://blog.npmjs.org/post/151660845210</guid><pubDate>Tue, 11 Oct 2016 08:00:33 -0700</pubDate><dc:creator>izs</dc:creator></item><item><title>out with the newww and in with the www: an update on the npm website</title><description>&lt;p&gt;From its inception, npm has been keenly focused on open source values. As we&amp;rsquo;ve grown as a company, however, we&amp;rsquo;ve learned the important lesson that making source code available under an open license is the &lt;em&gt;bare minimum&lt;/em&gt; for open source software. To take it even further, we&amp;rsquo;ve also learned that &amp;ldquo;open source&amp;rdquo; doesn&amp;rsquo;t necessarily mean community-driven. With these insights in mind, the web team has decided to make some changes to the community interface of npm&amp;rsquo;s website — with the goal of creating a more efficient and effective experience for everyone involved.&lt;/p&gt;

&lt;h2&gt;Summary&lt;/h2&gt;

&lt;ul&gt;&lt;li&gt;&lt;a href="https://github.com/npm/newww"&gt;&lt;code&gt;npm/newww&lt;/code&gt;&lt;/a&gt; is being retired and made private&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/npm/www"&gt;&lt;code&gt;npm/www&lt;/code&gt;&lt;/a&gt; has been created for new issues and release notes&lt;/li&gt;
&lt;/ul&gt;&lt;h2&gt;Sunsetting &lt;code&gt;npm/newww&lt;/code&gt;&lt;/h2&gt;

&lt;p&gt;As you may (or may not!) have noticed, the repo that used to home npm&amp;rsquo;s website (&lt;a href="https://github.com/npm/newww"&gt;&lt;code&gt;npm/newww&lt;/code&gt;&lt;/a&gt;) isn&amp;rsquo;t in sync with the &lt;a href="http://www.npmjs.com"&gt;production website (http://www.npmjs.com)&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A few months back, the team made the executive decision to close source the npm website. There were several reasons for this:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;Running the npm website locally was/still is very difficult (even for npm members!) due to a dependency on private API endpoints&lt;/li&gt;
&lt;li&gt;Open source tier Travis builds were holding back development pace &lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;This was a super tough call, and there were strong arguments from both sides. In the end, though, the team reached a unified understanding that this was both the best call for the company and for the community. The repo will be officially shutting down tomorrow, Friday, July 29, 2016.&lt;/p&gt;

&lt;p&gt;One of the things we&amp;rsquo;re aware of is that many in the Node community were using the website as an example repo for using the Hapi framework. While we&amp;rsquo;re completely flattered by this, we honestly don&amp;rsquo;t believe the codebase is currently in a state to serve that role — it&amp;rsquo;s a katamari of many practices over many years rolled into one right now!&lt;/p&gt;

&lt;p&gt;That being said, we do care about sharing our work with the world, and intend to and are excited to publish many of the website components as packages that will be open sourced and reusable.&lt;/p&gt;

&lt;h2&gt;Introducing &lt;code&gt;npm/www&lt;/code&gt;&lt;/h2&gt;

&lt;p&gt;In place of the &lt;code&gt;npm/newww&lt;/code&gt; repo, we&amp;rsquo;ve created &lt;a href="https://github.com/npm/www"&gt;&lt;code&gt;npm/www&lt;/code&gt;&lt;/a&gt;! The goals of this repo are to give the community a place to:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;File issues about display and performance bugs on the website&lt;/li&gt;
&lt;li&gt;Request new features of the website&lt;/li&gt;
&lt;li&gt;Publish release notes about the website&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;While the source code for the website will no longer be available, the hope is that this new repo can be a more effective way to organize and respond to the needs the community has.  We&amp;rsquo;re super excited to hear your thoughts, questions, and concerns — head over to &lt;a href="https://github.com/npm/www"&gt;&lt;code&gt;npm/www&lt;/code&gt;&lt;/a&gt; now so we can start collaborating!&lt;/p&gt;</description><link>http://blog.npmjs.org/post/148119862590</link><guid>http://blog.npmjs.org/post/148119862590</guid><pubDate>Thu, 28 Jul 2016 15:50:35 -0700</pubDate><dc:creator>agdubs</dc:creator></item><item><title>npm has a new CTO</title><description>&lt;p&gt;I don’t want to bury the lede, so here it is: npm has a new CTO, and her name is CJ Silverio. My title is changing from CTO to COO, and I will be taking over a range of new responsibilities, including modeling our business, defining and tracking our metrics, and bringing that data to bear on our daily operations, sales, and marketing. This will allow Isaac to concentrate more on defining the product and strategy of npm as we continue to grow.&lt;/p&gt;

&lt;p&gt;CJ will be following this post with a post of her own, giving her thoughts about her new role. I could write a long post about how awesome CJ is — and she &lt;em&gt;is&lt;/em&gt; awesome — but that wouldn’t achieve much more than make her embarrassed. Instead I thought I’d take this chance to answer a question I get a lot, before I forget the answer:&lt;/p&gt;

&lt;h2&gt;What does a CTO do, anyway?&lt;/h2&gt;

&lt;p&gt;The answer is that it depends on the needs of the company. npm has grown from 3 people to 25 in the past 2.5 years, and in that time my job changed radically from quarter to quarter. Every time I got the hang of the job, the needs of the company would shift and I found myself doing something new. So this is my list of some of the things a CTO &lt;em&gt;might&lt;/em&gt; do. Not all of them are a good idea, as you&amp;rsquo;ll see. The chronological order is an over-simplification: I was doing a small piece of all of these tasks all the time, but each quarter definitely had a focus, so I&amp;rsquo;ve talked about it then.&lt;/p&gt;

&lt;h4&gt;Q1 2014: just another ops engineer.&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Started this quarter: CJ, Raquel.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;npm Inc had a bumpy launch: the registry was extremely unstable, because it was running on insufficient hardware and had not been architected for high uptime. Our priority was to get the registry to stay up. I was spinning up hardware by hand, without the benefit of automation. By April we had found the hot spots and mostly met the load, but CJ was the first person to stridently make the case that we had to automate our way out of this. I handed operations to her.&lt;/p&gt;

&lt;h4&gt;Q2 2014: architect.&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Started: Ben, Forrest, Maciej.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Once the fires were out, we could finally think about building products, and we had a choice: do we build a paid product on top of the current (highly technically indebted) architecture, or build a new product and architecture? We decided on a new, modular architecture that we could use to build npm Enterprise first, and then extend later to become “Registry 2.0”. Between recruitment, management, and other duties, I discovered by the end of the quarter that it was already impossible to find time to write code.&lt;/p&gt;

&lt;h4&gt;Q3 2014: manager&lt;/h4&gt;

&lt;p&gt;This was the quarter we dug in and built &lt;a href="https://www.npmjs.com/enterprise"&gt;npm Enterprise&lt;/a&gt;. My job became primarily that of an engineering manager: keeping everybody informed about what everybody else was up to, assigning tasks, deciding priorities of new work vs. sustaining and operational work, and handling the kind of interpersonal issues which every growing company experiences. I found I was relying on CJ a lot when solving these kinds of problems.&lt;/p&gt;

&lt;h4&gt;Q4 2014: sales and evangelism&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Started: Rebecca&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;With npm Enterprise delivered to its first customer, we started learning how to sell it. I went to conferences, gave talks, went to meetings and sales calls, wrote documentation and blog posts, and generally tried to make noise. I was never particularly good at any of this, so I was grateful when Ben took over npm Enterprise as a product, which started around this time.&lt;/p&gt;

&lt;h4&gt;Q1 2015: data scientist&lt;/h4&gt;

&lt;p&gt;In February 2014 I had written the system that to this day serves our download counts, but we were starting a process of raising our series A, and that data wasn’t good enough. I dredged up my Hadoop knowledge from a previous job and started crunching numbers, getting new numbers we hadn’t seen before, like unique IP counts and other trends. This is one job I’m keeping as I move to COO, since measuring these metrics and optimizing them is a big part of my new role.&lt;/p&gt;

&lt;h4&gt;Q2 2015: recruiter&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Started: Ernie, Ryan&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We’d been hiring all the time, of course, but we closed our series A in Q1 2015, so there was a sudden burst of recruitment at this time, most of whom didn’t actually start until the next quarter. By the end of this process we’d hired so many people that I never had to do recruitment again: the teams were now big enough to interview and hire their own people.&lt;/p&gt;

&lt;h4&gt;Q3 2015: strategic planner&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Started: Kat, Stephanie, Emily, Jeff, Chris, Jonathan, Aria, Angela&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;With so many new people, we had a sudden burst of momentum, and it became necessary for the first time to devote substantial effort to planning “what do we do next?” Until this point the next move had been obvious: put out the fire, all hands on deck. Now we had enough people that some of them could work on longer-term projects, which was good news, but meant we had to pull our heads up and think about the longer term. To accomplish this, I handed management of nearly all the engineering team to CJ, who became VP of engineering.&lt;/p&gt;

&lt;h4&gt;Q4 2015: project manager&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Started: Ashley, Andrea, Andrew (yes, it was confusing)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We had already launched npm Private Modules, a single-user product, but it hadn’t really taken off. We were sure we knew why: &lt;a href="https://www.npmjs.com/features?utm_source=blog&amp;amp;utm_medium=tumblr&amp;amp;utm_content=laurie&amp;amp;utm_campaign=20160718cto"&gt;npm Organizations&lt;/a&gt;, a product for teams, was demanded by nearly everybody. It was a lot more complicated, and with more people there was a lot more coordination to do, so I started doing the kind of time, tasks, and dependency management of a project manager. I will be the first to admit that I was not particularly good at it, and nobody was upset when I mostly gave this task to Nicole the following quarter. We launched Orgs in November, and it was an instant hit, becoming half of npm’s revenue by the end of the year.&lt;/p&gt;

&lt;h4&gt;Q1 2016: head of product&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Started: Nicole, Jerry&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now with two product lines and a bunch of engineers, fully defining what the product should do (or not do), and what the next priority was, became critical. Isaac was too busy CEO’ing to do this, so he gave it to most available person: me. This was not a huge success, partly because I was still stuck in project management mode, which is a very different thing, and partly because I’m just not as creative as Isaac when it comes to product. Everybody learned something, even if it was “Laurie isn’t very good at this”.&lt;/p&gt;

&lt;h4&gt;Q2 2016: interim CEO&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Started: Kiera&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Isaac’s baby was born on April 1st (a fact that, combined with his not having mentioned they were even expecting a baby, led many people to assume at first that his &lt;a href="https://twitter.com/izs/status/716047022730530816"&gt;announcement of parenthood&lt;/a&gt; was a joke). He went on parental leave for most of Q2, so I took over as interim CEO. CJ, already VP of eng, effectively started being CTO at this time.&lt;/p&gt;

&lt;h4&gt;Today: COO&lt;/h4&gt;

&lt;p&gt;When Isaac came back from parental leave, we’d learned some things: I had, of necessity, handled the administrative and executive functions of a CEO for a quarter. CJ had handled those of a CTO. We now had two people who could be CTO, and one overloaded CEO with a talent for product. The course of action was obvious: Isaac handed over everything he could that was not-product to me, to focus on product development, while I handed over CTO duties to CJ. We needed a title for “CEO stuff that isn’t product” and picked COO mostly because it’s a title people recognize.&lt;/p&gt;

&lt;h2&gt;All hail CJ&lt;/h2&gt;

&lt;p&gt;You’ll notice a common thread, which is that as I moved to new tasks I was mostly handing them to CJ. Honestly, it was pretty clear to me from day 1 that CJ was just as qualified to be CTO as I was, if not more — she has an extra decade’s worth of experience on me and is a better engineer to boot. The only thing she lacked was the belief that she could, and over the last two and a half years it has been a pleasure watching her confidence grow as she’s mastered every new challenge I put in front of her, and more than a little funny watching her repeatedly express surprise at her ability to do all these things. It’s been like slowly persuading an amnesiac Clark Kent that he is, in fact, Superman.&lt;/p&gt;

&lt;p&gt;I’ve often referred to CJ as npm’s secret weapon. Well, now the secret is out. npm has the best CTO I could possibly imagine, and I can’t wait to see what she does next.&lt;/p&gt;</description><link>http://blog.npmjs.org/post/147604242320</link><guid>http://blog.npmjs.org/post/147604242320</guid><pubDate>Mon, 18 Jul 2016 11:46:44 -0700</pubDate><dc:creator>seldo</dc:creator></item><item><title>package tarball read outage today</title><description>&lt;p&gt;Earlier today, July 6, 2016, the npm registry experienced a read outage for 0.5% of all package tarballs for all network regions. Not all packages and versions were affected, but the ones that were affected were completely unavailable during the outage for any region of our CDN.&lt;/p&gt;

&lt;p&gt;The unavailable tarballs were offline for about 16 hours, from mid-afternoon PDT on July 5 to early morning July 6. All tarballs should now be available for read.&lt;/p&gt;

&lt;p&gt;Here&amp;rsquo;s the outage timeline:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;Evening of 2016 July 1: We pushed code that implemented a change in how we generate etags for tarballs for for new publications only.&lt;/li&gt;
&lt;li&gt;Midday 2016 July 6: We commenced running a script that updated all existing tarballs on all servers to the new etags scheme. This ran over the course of some hours.&lt;/li&gt;
&lt;li&gt;10pm PDT 2016 July 5: We received a report of some 502s being returned by some servers. In this course of investigating this, we observed a known issue with a very slow process leak in an existing service. We cleared up the known issue in the mistaken belief that this was causing the 502s.&lt;/li&gt;
&lt;li&gt;6am PDT 2016 July 6: We received more reports of 502s on tarballs, and opened &lt;a href="https://manage.statuspage.io/pages/wyvgptkd90hm/incidents/nl2mpgltpnvj"&gt;a status incident&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;8am PDT: The root cause of the issue was identified as a negative file modification times for the specific affected tarballs. A new script was immediately run to fix mtimes on all tarball files appearing in the logs as producing 502 errors.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Over the next hour 502 rates fell to the normal 0.&lt;/p&gt;

&lt;h2&gt;What we&amp;rsquo;re doing to prevent outages like this next time&lt;/h2&gt;

&lt;p&gt;We&amp;rsquo;re adding an alert on all 500-class status codes, not just 503s. This alert will catch the category of errors, not simply this specific problem.&lt;/p&gt;

&lt;p&gt;We&amp;rsquo;re also revising our operational playbook to encourage examination of our CDN logs more frequently; we could have caught the problem very soon after introducing it if we had carefully verified that our guess about the source of 502s had resulted in making them vanish from our CDN logging. We can also do better with tools for examining the patterns of errors across POPs, which would have made it clearer to us immediately that the error was not specific to the US East coast and was therefore unlikely to have been caused by an outage in our CDN.&lt;/p&gt;

&lt;p&gt;Read on if you would like the details of the bug.&lt;/p&gt;

&lt;h2&gt;nginx and etags&lt;/h2&gt;

&lt;p&gt;The root cause for this outage was an interesting interaction of file modification time, nginx&amp;rsquo;s method of generating etags, and cache headers.&lt;/p&gt;

&lt;p&gt;We recently examined our CDN caching strategies and learned that we were not caching as effectively as we might, because of a property of nginx. Nginx&amp;rsquo;s etags are generated using the file modification time as well as its size, roughly as &lt;code&gt;mtime + '-' + the file size in bytes&lt;/code&gt;. This meant that if mtimes for package tarballs varied across our nginx instances, our CDN would treat the files from each server as distinct, and cache them separately. Getting the most from our CDN&amp;rsquo;s caches and from our users&amp;rsquo; local tarball caches is key to good performance on npm installs, so we took steps to make the etags match across all our services.&lt;/p&gt;

&lt;p&gt;Our chosen scheme was to set the file modification time to the first 32-bit BE integer from their md5 hash. This was entirely arbitrary but looked sufficient after testing in our staging environment. We produced consistent etags. Unfortunately, the script that applied this change to our production environment failed to clamp the resulting integer, resulting in negative numbers for timestamps. Ordinarily, this would result in a the infamous Dec 31, 1969 date one sees for timestamps before the Unix epoch.&lt;/p&gt;

&lt;p&gt;Unfortunately, negative mtimes triggered an nginx bug. Nginx will serve the first request for a file in this state and deliver the negative etag. However, if there is a negative etag in the &lt;code&gt;if-none-match&lt;/code&gt; header nginx attempts to serve a 304 but never completes the request. This resulted in the the bad gateway message returned by our CDN to users attempting to fetch a tarball with the bad mtime.&lt;/p&gt;

&lt;p&gt;You can observe this behavior yourself with nginx and curl:&lt;/p&gt;

&lt;script src="https://gist.github.com/ceejbot/8566110d47b044f5efddd8a5d38c8412.js"&gt;&lt;/script&gt;&lt;p&gt;The final request never completes even though nginx has correctly given it a 304 status.&lt;/p&gt;

&lt;p&gt;Because this only affected a small subset of tarballs, &lt;em&gt;not&lt;/em&gt; including the tarball fetched by our smoketest alert, all servers remained in the pool. We have an alert on above-normal 503 error rates served by our CDN, but this error state produced 502s and was not caught.&lt;/p&gt;

&lt;p&gt;All the tarballs that were producing a 502 gateway timeout error turned out to have negative timestamps in their file mtimes. The fix was to touch them all so their times were inconsistent across our servers but valid, thus both busting our CDN&amp;rsquo;s cache and dodging the nginx behavior.&lt;/p&gt;

&lt;h2&gt;tl;dr&lt;/h2&gt;

&lt;p&gt;The logs from our CDN are invaluable, because they tell us what quality of service our users are truly experiencing. Sometimes everything looks green on our own monitoring, but it&amp;rsquo;s not green from our users&amp;rsquo; perspective. The logs are how we know.&lt;/p&gt;</description><link>http://blog.npmjs.org/post/147012483540</link><guid>http://blog.npmjs.org/post/147012483540</guid><pubDate>Wed, 06 Jul 2016 14:45:04 -0700</pubDate><category>postmortem</category><category>npm</category><category>npm registry</category><category>nginx</category><category>surprising bugs</category><category>we like nginx</category><dc:creator>ceejbot</dc:creator></item><item><title>Introducing add-ons for npm Enterprise</title><description>&lt;p&gt;&lt;img src="https://partners.npmjs.com/blog/2016-07-04/laptop-typing-4-cropped.png" style="max-width: 100%;" title="npm loves your enterprise add-on!" alt="image"/&gt;&lt;/p&gt;

&lt;p&gt;Today, &lt;a href="https://www.npmjs.com/enterprise?utm_source=blog&amp;amp;utm_medium=tumblr&amp;amp;utm_content=bentext&amp;amp;utm_campaign=20160705addons" title="npm Enterprise"&gt;npm Enterprise&lt;/a&gt; has just grown hugely more extensible and powerful with the release of &lt;strong&gt;npm Enterprise add-ons&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It’s now possible to integrate third-parties’ developer tools directly into npm Enterprise. This has the power to combine what were discrete parts of your development workflow into a single user experience, and knock out the barriers that stand in the way of bringing open source development’s many-small-reusable-parts methodology into larger organizations.&lt;/p&gt;

&lt;h2&gt;What are npm Enterprise add-ons?&lt;/h2&gt;

&lt;p&gt;npm Enterprise now exposes an API that allows third-party developers to build on top of our npm Enterprise product:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;add additional UI components to enterprise customers’ private npm websites;&lt;/li&gt;
&lt;li&gt;add hooks to package installation and publishing events;&lt;/li&gt;
&lt;li&gt;automate important parts of the software development lifecycle — for example, to automatically apply a security scan when you attempt to install a package for the first time.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;With this deceptively simple functionality, developers can offer a huge amount of value to enrich the process of using npm within the enterprise.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://partners.npmjs.com/blog/2016-07-04/add-ons-in-npm-enterprise-sidebar.png" target="_blank"&gt;&lt;img src="https://partners.npmjs.com/blog/2016-07-04/add-ons-in-npm-enterprise-sidebar.png" style="max-width: 100%;" title="add-ons in npm Enterprise" alt="image"/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Why?&lt;/h2&gt;

&lt;p&gt;Enterprise developers already want to take advantage of the same code discovery, re-use, and collaboration enjoyed by &lt;a href="http://blog.npmjs.org/post/143451680695/how-many-npm-users-are-there?utm_source=blog&amp;amp;utm_medium=tumblr&amp;amp;utm_content=bentext&amp;amp;utm_campaign=20160705addons" title="The npm Blog: how many npm users are there?"&gt;millions of open source developers, billions of times every month&lt;/a&gt;. But this requires accommodating their companies’ op-sec, licensing, and code quality processes, which often predate the modern era.&lt;/p&gt;

&lt;p&gt;For example…&lt;/p&gt;

&lt;h3&gt;Enterprises have strict security restrictions.&lt;/h3&gt;

&lt;p&gt;In the past, it was possible to manually research the security implications of external code. But with the average npm package relying on over 100 dependencies and subdependencies, this process just doesn’t scale.&lt;/p&gt;

&lt;p&gt;Without a way to ensure the security of each package, a company can’t take advantage of open source code.&lt;/p&gt;

&lt;h3&gt;Enterprises strictly enforce license compliance.&lt;/h3&gt;

&lt;p&gt;Software that is missing a license, or that’s governed by a license unblessed by a company’s legal department, simply can’t be used at larger companies. Much like security screening, many companies have relied upon manually reviewing the license requirements of each piece of external code. And just like security research, trying to manually confirm the licensing of every dependency (and their dependencies, and &lt;em&gt;their&lt;/em&gt; dependencies…) is impossible to scale.&lt;/p&gt;

&lt;p&gt;Enterprise developers need a way to understand the license implications of packages they’re considering using, and companies need a way to certify that all of their projects are legally kosher.&lt;/p&gt;

&lt;h3&gt;Enterprises depend on good software development practices.&lt;/h3&gt;

&lt;p&gt;Will bug reports be patched quickly? Is the code written well? Do packages rely on stale or abandoned dependencies? These questions demand answers before an enterprise can consider relying on open source code.&lt;/p&gt;

&lt;p&gt;Without a way to quantitatively analyze the quality of every code package in a project, many enterprise teams simply don’t adopt open source code or workflows for mission-critical projects.&lt;/p&gt;

&lt;p&gt;Our three launch partners, &lt;strong&gt;&lt;a href="https://nodesecurity.io" title="Node Security Platform"&gt;Node Security Platform&lt;/a&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;a href="http://fossa.io" title="FOSSA - Open Source Compliance at the Speed of Development"&gt;FOSSA&lt;/a&gt;&lt;/strong&gt;, and &lt;strong&gt;&lt;a href="https://www.bithound.io" title="bitHound: Node.js code analysis your team can agree on"&gt;bitHound&lt;/a&gt;&lt;/strong&gt;, address these concerns, respectively.&lt;/p&gt;

&lt;p&gt;You can learn about the specifics of each of them here:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;a href="https://medium.com/node-security/announcing-npm-enterprise-security-add-on-6dde303efb9f#.q5mfaghrq"&gt;Announcing the Node Security Project’s npm Enterprise Add-On &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://fossa.io/blog/fossa-partners-with-npm/"&gt;npm partners with FOSSA to deliver open source license compliance to enterprise JavaScript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://blog.bithound.io/bithound-introduces-npm-enterprise-addon"&gt;bitHound introduces npm Enterprise add-on&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;By integrating them directly into the tool that enterprise developers use to browse and manage packages, we make it as easy as possible to scratch enterprise development’s specific itches. As more incredible add-ons join the platform, the barriers to open source-style development at big companies get knocked down, one by one.&lt;/p&gt;

&lt;h2&gt;Now what?&lt;/h2&gt;

&lt;p&gt;The Node Security Platform, FOSSA, and bitHound add-ons are available to existing npm Enterprise customers today. Simply contact us at &lt;a href="mailto:support@npmjs.com"&gt;support@npmjs.com&lt;/a&gt; to get set up.&lt;/p&gt;

&lt;p&gt;If you’re looking to bring npm Enterprise and add-ons into your enterprise, let us show you how easy it is with a &lt;a href="https://www.npmjs.com/enterprise/?utm_source=blog&amp;amp;utm_medium=tumblr&amp;amp;utm_content=bentext&amp;amp;utm_campaign=20160705addons"&gt;free 30-day trial&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Interested in building your own add-on? Awesome. Stay tuned: API documentation is on its way.&lt;/p&gt;

&lt;h2&gt;This is just the beginning&lt;/h2&gt;

&lt;p&gt;The movement to bring open source code, workflows, and tools into the enterprise is called &lt;a href="http://blog.npmjs.org/post/139373244435/practices-perfected-in-oss-can-reshape-enterprise?utm_source=blog&amp;amp;utm_medium=tumblr&amp;amp;utm_content=bentext&amp;amp;utm_campaign=20160705addons"&gt;InnerSource&lt;/a&gt;, and it’s the beginning of a revolution.&lt;/p&gt;

&lt;p&gt;When companies develop proprietary code the same way communities build open source projects, then the open source community’s methods and tooling become the default way to build software.&lt;/p&gt;

&lt;p&gt;Everyone stands to benefit from InnerSource because everyone stands to benefit from building software the right way: open source packages see more adoption and community participation, companies build projects faster and cheaper without re-inventing wheels, and developers are empowered to build amazing things.&lt;/p&gt;

&lt;p&gt;Add-ons are an exciting step forward for us. We’re thrilled you’re joining us.&lt;/p&gt;</description><link>http://blog.npmjs.org/post/146943134240</link><guid>http://blog.npmjs.org/post/146943134240</guid><pubDate>Tue, 05 Jul 2016 05:58:57 -0700</pubDate><dc:creator>bencoe</dc:creator></item><item><title>dealing with problematic dependencies in a restricted network environment</title><description>&lt;p&gt;When using npm Enterprise, we sometimes encounter public packages in our private registry that need to fetch resources from the public internet when being installed by a client via &lt;code&gt;npm install&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Unfortunately, this poses a problem for developers who work in an environment with limited or no access to the public internet.&lt;/p&gt;

&lt;p&gt;Let’s take a look at some of the more common types of problems in this area and talk about ways we can work around them.&lt;/p&gt;

&lt;p&gt;Note that these problems are not specific to npm Enterprise — but to using certain public packages in any limited-access environment. That being said, there are some things that npm (as an organization and software vendor) can do to better prevent or handle some of these problems. We’re still working to make these improvements.&lt;/p&gt;

&lt;h2&gt;Diagnosing the Problem&lt;/h2&gt;

&lt;p&gt;Typically, developers will discover the problem when installing packages from their private registry. When this happens, we need to determine the type of problem it is and where in the dependency graph the problematic dependency resides.&lt;/p&gt;

&lt;h3&gt;Problem Types&lt;/h3&gt;

&lt;p&gt;Here are some common problem types:&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;&lt;p&gt;Git repo dependency&lt;/p&gt;

&lt;p&gt;This is when a package dependency is listed in a &lt;code&gt;package.json&lt;/code&gt; file with a reference to a Git repository instead of with a semver version range. Typically these point to a particular branch or revision in a public GitHub or Bitbucket repository. They are mainly used when the package contents have not been published to the public npm registry.&lt;/p&gt;

&lt;p&gt;When the npm client encounters these, it attempts to fetch the package from the Git repository directly, which is a problem for folks who do not have network access to the repository.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Shrinkwrapped package&lt;/p&gt;

&lt;p&gt;This is when the internal contents of a package contain an &lt;code&gt;npm-shrinkwrap.json&lt;/code&gt; file that lists a specific version and URL to use for each mentioned package from the dependency tree.&lt;/p&gt;

&lt;p&gt;During a normal &lt;code&gt;npm install&lt;/code&gt;, the npm client attempts to fetch the dependencies listed in &lt;code&gt;npm-shrinkwrap.json&lt;/code&gt; directly from the URLs contained in the file. This poses a problem when the client installing the shrinkwrapped package does not have access to the URLs that the shrinkwrap author has access to.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Package with install script or node-gyp dependency&lt;/p&gt;

&lt;p&gt;This is when a package attempts to defer some setup process until the package is installed, using a script defined in &lt;code&gt;package.json&lt;/code&gt;, which typically involves building platform-specific binaries or Node add-ons on the client&amp;rsquo;s machine.&lt;/p&gt;

&lt;p&gt;On a typical install, the npm client will find and run these scripts in order to automatically fetch and build the required resources, targeting the platform that the client is running on. But when limited internet access means the necessary resources cannot be fetched, the install will fail. Most likely the package will be unusable until the end result of running the install script on the client&amp;rsquo;s machine is achieved.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;Direct vs Transitive&lt;/h3&gt;

&lt;p&gt;To determine the location of the problematic dependency, we can boil it down to two categories:&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;&lt;p&gt;Direct dependency&lt;/p&gt;

&lt;p&gt;A direct dependency is one that is explicitly listed in your own &lt;code&gt;package.json&lt;/code&gt; file — a dependency that your project/package uses directly in code or in an npm run script.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Transitive dependency&lt;/p&gt;

&lt;p&gt;A transitive dependency is one that is &lt;strong&gt;not&lt;/strong&gt; explicitly listed in your own &lt;code&gt;package.json&lt;/code&gt; file — a dependency that comes from anywhere in the tree of your direct dependencies’ dependencies.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;h2&gt;Potential Solutions&lt;/h2&gt;

&lt;p&gt;The same way publishing a package to the public registry requires access to the public internet, most of these solutions require Internet access, at least on a temporary basis. Once the solution is in place, then access to public resources can be restricted.&lt;/p&gt;

&lt;p&gt;For starters, remember that it’s generally a good idea to use the latest version of the &lt;code&gt;npm&lt;/code&gt; client. To install or upgrade to the latest version, regardless of what version of Node you have installed, run &lt;code&gt;npm i -g npm@latest&lt;/code&gt; (and make sure &lt;code&gt;npm -v&lt;/code&gt; prints the version that was installed).&lt;/p&gt;

&lt;p&gt;Let’s go over the problem types in more detail.&lt;/p&gt;

&lt;h3&gt;Replacing a Git dependency&lt;/h3&gt;

&lt;p&gt;Unfortunately, a dependency that references a Git repository (instead of a semver range for a published package) must be replaced with a published package. To do this, you’ll need to first publish the Git repository as a package to your npm Enterprise registry and then fork the project with the Git dependency and replace the dependency with the package you published. Then, publish the forked project, and use &lt;em&gt;that&lt;/em&gt; package as a dependency (instead of the original).&lt;/p&gt;

&lt;p&gt;It’s usually a good idea to open an issue on the project with the Git dependency, politely asking the maintainers to replace the Git dependency, if possible. Generally, we discourage using Git dependencies in &lt;code&gt;package.json&lt;/code&gt;, and it’s typically only used temporarily while a maintainer waits for an upstream fix to be applied and published.&lt;/p&gt;

&lt;p&gt;Example: let’s replace the &lt;a href="https://github.com/webdriverio/webdriverio/blob/v4.0.4/package.json#L77"&gt;&lt;code&gt;"grunt-mocha-istanbul": "christian-bromann/grunt-mocha-istanbul"&lt;/code&gt;&lt;/a&gt; Git dependency defined in version 4.0.4 of the &lt;a href="https://github.com/webdriverio/webdriverio/tree/v4.0.4"&gt;&lt;code&gt;webdriverio&lt;/code&gt;&lt;/a&gt; package, assuming that &lt;code&gt;webdriverio&lt;/code&gt; is a direct dependency and &lt;code&gt;grunt-mocha-istanbul&lt;/code&gt; is a transitive dependency.&lt;/p&gt;

&lt;p&gt;We&amp;rsquo;ll tackle this in two main steps: forking and publishing the transitive dependency, and forking and publishing the direct dependency.&lt;/p&gt;

&lt;h4&gt;Step 1: Fork-publish the transitive dependency&lt;/h4&gt;

&lt;ol&gt;&lt;li&gt;&lt;p&gt;Clone the project that is referenced by the Git dependency&lt;/p&gt;

&lt;p&gt;Optionally, you can create a remote fork first (e.g., in GitHub or Bitbucket) and then clone your fork locally. Otherwise, you can just clone/download the project directly from the remote repository. It’s a good idea to use source control so you can keep a history of your changes, but you could also probably get away with downloading and extracting the project contents.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git clone &lt;a href="https://github.com/christian-bromann/grunt-mocha-istanbul.git"&gt;https://github.com/christian-bromann/grunt-mocha-istanbul.git&lt;/a&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a new branch to hold your customizations&lt;/p&gt;

&lt;p&gt;Again, this is so you can keep a history of your changes. It’s probably a good idea to include the current version of the package in the branch name, in case you need to repeat these steps when a later version is available.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cd grunt-mocha-istanbul
git checkout -b myco-custom-3.0.1
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add your scope to the package name in &lt;code&gt;package.json&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In our example, change &lt;code&gt;"grunt-mocha-istanbul"&lt;/code&gt; to &lt;code&gt;"@myco/grunt-mocha-istanbul"&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Commit your changes to your branch and publish the scoped package to your npm Enterprise registry&lt;/p&gt;

&lt;p&gt;Assuming you have already configured &lt;code&gt;npm&lt;/code&gt; to associate your scope to your private registry, publishing should be as simple as &lt;code&gt;npm publish&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git add package.json
git commit -m 'add @myco scope to package name'
npm publish
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;h4&gt;Step 2: Fork-publish the direct dependency&lt;/h4&gt;

&lt;ol&gt;&lt;li&gt;&lt;p&gt;Clone the project’s source code locally&lt;/p&gt;

&lt;p&gt;Either create a remote fork first (e.g., in GitHub or Bitbucket) and clone your fork locally, or just clone/download the project directly from the original remote repository. It’s a good idea to use source control so you can keep a history of your changes.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git clone &lt;a href="https://github.com/webdriverio/webdriverio.git"&gt;https://github.com/webdriverio/webdriverio.git&lt;/a&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a new branch to hold your customizations&lt;/p&gt;

&lt;p&gt;This is so you can keep a history of your changes. It’s probably a good idea to include the current version of the package in the branch name, in case you need to repeat these steps when a later version is available.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cd webdriverio
git checkout -b myco-custom-4.0.4
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add your scope to the package name in &lt;code&gt;package.json&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In our example, change &lt;code&gt;"webdriverio"&lt;/code&gt; to &lt;code&gt;"@myco/webdriverio"&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Replace the Git dependency with the scoped package&lt;/p&gt;

&lt;p&gt;This means updating the reference in &lt;code&gt;package.json&lt;/code&gt;, and it may mean updating &lt;code&gt;require()&lt;/code&gt; or &lt;code&gt;import&lt;/code&gt; statements too. You should basically do a find-and-replace, finding the unscoped package name and judiciously replacing it with the scoped package name.&lt;/p&gt;

&lt;p&gt;In our example, we only need to update the reference in &lt;code&gt;package.json&lt;/code&gt; from &lt;code&gt;"grunt-mocha-istanbul": "christian-bromann/grunt-mocha-istanbul"&lt;/code&gt; to &lt;code&gt;"@myco/grunt-mocha-istanbul": "^3.0.1"&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Commit your changes to your branch and publish the scoped package to your npm Enterprise registry&lt;/p&gt;

&lt;p&gt;Assuming you’ve already configured &lt;code&gt;npm&lt;/code&gt; to associate your scope to your private registry, publishing should be as simple as &lt;code&gt;npm publish&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In our example of &lt;code&gt;webdriverio&lt;/code&gt;, we next need to deal with the shrinkwrap URLs before we can publish (handled below). In other scenarios, it may be possible to publish now.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git add .
git commit -m 'replace git dep with scoped fork'
npm publish
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Update your downstream project(s) to use the scoped package as a direct dependency (in &lt;code&gt;package.json&lt;/code&gt; and in any &lt;code&gt;require()&lt;/code&gt; statements)&lt;/p&gt;

&lt;p&gt;In our example, this basically means doing a find-and-replace to find references to &lt;code&gt;webdriverio&lt;/code&gt; and judiciously replace them with &lt;code&gt;@myco/webdriverio&lt;/code&gt;. However, &lt;code&gt;webdriverio&lt;/code&gt; also contains an &lt;code&gt;npm-shrinkwrap.json&lt;/code&gt; file. We’ll cover that in the next section.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;Working with a shrinkwrapped package&lt;/h3&gt;

&lt;p&gt;It just so happens that our sample direct dependency above (&lt;code&gt;webdriverio&lt;/code&gt;) also uses an &lt;code&gt;npm-shrinkwrap.json&lt;/code&gt; file to pin certain dependencies to specific versions. Unfortunately the shrinkwrap file contains hardcoded URLs to the public registry. We need a way to either ignore or fix the URLs.&lt;/p&gt;

&lt;h4&gt;Shrinkwrap Option 1: Ignore the shrinkwrap&lt;/h4&gt;

&lt;p&gt;A quick workaround is to install packages using the &lt;code&gt;--no-shrinkwrap&lt;/code&gt; flag. This will tell the &lt;code&gt;npm&lt;/code&gt; client to ignore any shrinkwrap files it finds in the package dependency tree and, instead, install the dependencies from &lt;code&gt;package.json&lt;/code&gt; in the normal fashion.&lt;/p&gt;

&lt;p&gt;This is considered a workaround rather than a long-term solution: it’s possible that installing from &lt;code&gt;package.json&lt;/code&gt; will install versions of dependencies that don’t exactly match the ones listed in &lt;code&gt;npm-shrinkwrap.json&lt;/code&gt;, even though the versions of the package’s direct dependencies are guaranteed to be within the declared semver range.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;npm install webdriverio --no-shrinkwrap
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;(As noted above, &lt;code&gt;webdriverio@4.0.4&lt;/code&gt; also has a Git dependency, so just ignoring the shrinkwrap isn’t quite enough for this package.)&lt;/p&gt;

&lt;h4&gt;Shrinkwrap Option 2: Fix the URLs&lt;/h4&gt;

&lt;p&gt;If you want to use the exact versions from the shrinkwrap file without using the URLs in it, you’ll have to use your own custom fork of the project that contains a modified shrinkwrap file.&lt;/p&gt;

&lt;p&gt;Here’s the general idea:&lt;/p&gt;

&lt;p&gt;(Note that steps 1-3 are identical to the fork-publish instructions for a direct dependency above. If you’ve already completed them, skip to step 4.)&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;&lt;p&gt;Clone the project’s source code locally&lt;/p&gt;

&lt;p&gt;Either create a remote fork first (e.g., in GitHub or Bitbucket) and clone your fork locally, or just clone/download the project directly from the original remote repository. It’s a good idea to use source control so you can keep a history of your changes.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git clone &lt;a href="https://github.com/webdriverio/webdriverio.git"&gt;https://github.com/webdriverio/webdriverio.git&lt;/a&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a new branch to hold your customizations&lt;/p&gt;

&lt;p&gt;This is so you can keep a history of your changes. It’s probably a good idea to include the current version of the package in the branch name, in case you need to repeat these steps when a later version is available.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cd webdriverio
git checkout -b myco-custom-4.0.4
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add your scope to the package name in &lt;code&gt;package.json&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In our example, change &lt;code&gt;"webdriverio"&lt;/code&gt; to &lt;code&gt;"@myco/webdriverio"&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use &lt;a href="https://www.npmjs.com/package/rewrite-shrinkwrap-urls"&gt;&lt;code&gt;rewrite-shrinkwrap-urls&lt;/code&gt;&lt;/a&gt; to modify &lt;code&gt;npm-shrinkwrap.json&lt;/code&gt;, pointing the URLs to your npm Enterprise registry&lt;/p&gt;

&lt;p&gt;Unfortunately this is slightly more complicated than a find-and-replace, since the tarball URL structure of the public registry is different than the one used for an npm Enterprise private registry.&lt;/p&gt;

&lt;p&gt;In the example below, replace &lt;code&gt;{your-registry}&lt;/code&gt; with the base URL of your private registry, e.g., &lt;code&gt;&lt;a href="https://npm-registry.myco.com"&gt;https://npm-registry.myco.com&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;http://localhost:8080&lt;/code&gt;. The value you use should come from the &lt;strong&gt;Full URL of npm Enterprise registry&lt;/strong&gt; setting in your Enterprise admin UI Settings page.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;npm install -g rewrite-shrinkwrap-urls
rewrite-shrinkwrap-urls -r {your-registry}
git diff npm-shrinkwrap.json
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Commit your changes to your branch and publish the scoped package to your npm Enterprise registry&lt;/p&gt;

&lt;p&gt;Assuming you’ve already configured &lt;code&gt;npm&lt;/code&gt; to associate your scope to your private registry, publishing should be as simple as &lt;code&gt;npm publish&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Be mindful of any &lt;code&gt;prepublish&lt;/code&gt; or &lt;code&gt;publish&lt;/code&gt; scripts that may be defined in &lt;code&gt;package.json&lt;/code&gt;. You can try skipping those scripts when publishing via &lt;code&gt;npm publish --ignore-scripts&lt;/code&gt;, but running the scripts may be necessary to put the package into a usable state, e.g., if source transpilation is required.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git add npm-shrinkwrap.json package.json
git commit -m 'add @myco scope to package name' package.json
git commit -m 'rewrite shrinkwrap urls' npm-shrinkwrap.json
npm publish
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Note that a &lt;code&gt;prepublish&lt;/code&gt; script will probably need to install the package’s dependencies in order to run. In this case, &lt;code&gt;npm install&lt;/code&gt; will be executed first. If this happens, it should pull all dependencies in the shrinkwrap file from your registry. If any of those packages don’t yet exist in your registry, you’ll need either to enable the &lt;strong&gt;Read Through Cache&lt;/strong&gt; setting in your Enterprise instance or to manually add the packages to the white-list by running &lt;code&gt;npme add-package webdriverio&lt;/code&gt; from your server’s shell and answering &lt;code&gt;Y&lt;/code&gt; at the prompt to add dependencies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Update your downstream project(s) to use the scoped package as a direct dependency (in &lt;code&gt;package.json&lt;/code&gt; and in any &lt;code&gt;require()&lt;/code&gt; statements)&lt;/p&gt;

&lt;p&gt;In our example, this basically means doing a find-and-replace to find references to &lt;code&gt;webdriverio&lt;/code&gt; and judiciously replace them with &lt;code&gt;@myco/webdriverio&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;This is less than ideal, obviously. We’re currently considering ways to improve handling of shrinkwrapped packages on the server side, but a better solution is not yet available.&lt;/p&gt;

&lt;h3&gt;Packages with install scripts or node-gyp dependencies&lt;/h3&gt;

&lt;p&gt;Some packages want or need to run some script(s) on installation in order to build platform-specific dependencies or otherwise put the package into a usable state. This approach means that a package can be distributed as platform-independent source without having to prebundle binaries or provide multiple installation options.&lt;/p&gt;

&lt;p&gt;Unfortunately this also means that these packages typically need access to the public internet in order to fetch required resources. In these cases, we can’t really do much to work around this approach, other than attempt to isolate the steps of fetching the package from the registry and set up the platform-specific resources it needs.&lt;/p&gt;

&lt;h4&gt;Ignore install scripts&lt;/h4&gt;

&lt;p&gt;As a quick first attempt, you can ignore lifecycle scripts when installing packages via &lt;code&gt;npm install {pkg-name} --ignore-scripts&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Unfortunately, install scripts typically do some sort of platform-specific setup to make the package usable. Thus, you should review the &lt;code&gt;install&lt;/code&gt; or &lt;code&gt;postinstall&lt;/code&gt; scripts from the package’s &lt;code&gt;package.json&lt;/code&gt; file and determine if you need to attempt to run them separately or somehow achieve the same result manually.&lt;/p&gt;

&lt;h4&gt;Set up node-gyp build toolchain manually&lt;/h4&gt;

&lt;p&gt;When node-gyp is involved in the setup process, the package requires platform-specific binaries to be built and plugged into the Node runtime on the client’s system. In order to build the binaries, the package will typically need to fetch source header files for the Node API.&lt;/p&gt;

&lt;p&gt;The best we can do is attempt to setup the node-gyp build toolchain manually. This requires Python and a C/C++ compiler. You can read more about this at the following locations:&lt;/p&gt;

&lt;p&gt;General installation: &lt;a href="https://github.com/nodejs/node-gyp#installation"&gt;https://github.com/nodejs/node-gyp#installation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Windows issues: &lt;a href="https://github.com/nodejs/node-gyp/issues/629"&gt;https://github.com/nodejs/node-gyp/issues/629&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A good example of a package with a node-gyp dependency is &lt;a href="https://github.com/sass/node-sass"&gt;&lt;code&gt;node-sass&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once the build toolchain is in place, the package’s install script may not need to fetch any external resources.&lt;/p&gt;

&lt;h2&gt;What’s next?&lt;/h2&gt;

&lt;p&gt;If you’ve made it all the way to the end, surely you’ll agree that npm could be handling things better to minimize challenges faced by folks with restricted internet access. We feel it’s in the community’s best interest to at least raise awareness of these problems and their potential workarounds until we can get a more robust solution in place.&lt;/p&gt;

&lt;p&gt;If you have feedback or questions, as always, please don’t hesitate to let us know.&lt;/p&gt;</description><link>http://blog.npmjs.org/post/145724408060</link><guid>http://blog.npmjs.org/post/145724408060</guid><pubDate>Fri, 10 Jun 2016 14:38:30 -0700</pubDate><category>enterprise</category><dc:creator>nexdrew</dc:creator></item><item><title>Introducing hooks: get notifications of npm registry and package changes as they happen</title><description>&lt;p&gt;Today, we’re excited to announce a simple, powerful new way to track changes to the npm registry — and build your own amazing new developer tools: &lt;em&gt;hooks&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;What?&lt;/h2&gt;

&lt;p&gt;Hooks are notifications of npm registry events that you’ve subscribed to. Using hooks, you can build integrations that do something useful (or silly) in response to package changes on the registry.&lt;/p&gt;

&lt;p&gt;Each time a package is changed, we’ll send an HTTP POST payload to the URI you’ve configured for your hook. You can add hooks to follow specific packages, to follow all the activity of given npm users, or to follow all the packages in an organization or user scope.&lt;/p&gt;

&lt;p&gt;For example, you could watch all packages published in the &lt;code&gt;@npm&lt;/code&gt; scope by setting up a hook for &lt;code&gt;@npm&lt;/code&gt;. If you wanted to watch just &lt;code&gt;lodash&lt;/code&gt;, you could set up a hook for &lt;code&gt;lodash&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;When?&lt;/h2&gt;

&lt;p&gt;If you have a paid &lt;a href="https://www.npmjs.com/npm/private-packages"&gt;individual or organizational npm account&lt;/a&gt;, you can start using hooks right now.&lt;/p&gt;

&lt;p&gt;Each user may configure a total of 100 hooks, and how you use them is up to you: you can put all 100 on a single package, or scatter them across 100 different packages. If you use a hook to watch a scope, this counts as a single hook, regardless of how many packages are in the scope. You can watch any open source package on the npm registry, and any private package that you control (you’ll only receive hooks for packages you have permission to see).&lt;/p&gt;

&lt;h2&gt;How?&lt;/h2&gt;

&lt;p&gt;&lt;figure class="tmblr-full" data-orig-height="672" data-orig-width="1274" data-orig-src="https://cldup.com/jNJkdPk0AW.png"&gt;&lt;img src="http://68.media.tumblr.com/522a8b1fcfb7c366100ff2fb9a6eda4d/tumblr_inline_o83v3c9gWT1qa1p6q_540.png" alt="full Slack integration" data-orig-height="672" data-orig-width="1274" data-orig-src="https://cldup.com/jNJkdPk0AW.png"/&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;Create your first hook right now using the &lt;a href="https://www.npmjs.com/packages/wombat"&gt;wombat&lt;/a&gt; cli tool.&lt;/p&gt;

&lt;p&gt;First, install &lt;code&gt;wombat&lt;/code&gt; the usual way: &lt;code&gt;npm install -g wombat&lt;/code&gt;. Then, set up some hooks:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Watch the &lt;code&gt;npm&lt;/code&gt; package:&lt;/strong&gt;
&lt;code&gt;wombat hook add npm &lt;a href="https://example.com/webhooks"&gt;https://example.com/webhooks&lt;/a&gt; shared-secret-text&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Watch the &lt;code&gt;@slack&lt;/code&gt; organization for updates to their API clients:&lt;/strong&gt;
&lt;code&gt;wombat hook add @slack &lt;a href="https://example.com/webhooks"&gt;https://example.com/webhooks&lt;/a&gt; but-sadly-not-very-secret&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Watch the ever-prolific substack:&lt;/strong&gt;
&lt;code&gt;wombat hook add --type=owner substack &lt;a href="https://example.com/webhooks"&gt;https://example.com/webhooks&lt;/a&gt; this-secret-is-very-shared&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Look at all your hooks and when they were last triggered:&lt;/strong&gt;
&lt;code&gt;wombat hook ls&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Protip: Wombat has several other interesting commands. &lt;code&gt;wombat --help&lt;/code&gt; will tell you all about them.&lt;/p&gt;

&lt;p&gt;We’re also making public an API for working with hooks. &lt;a href="https://github.com/npm/registry/tree/master/docs/hooks"&gt;Read the docs&lt;/a&gt; for details on how you can use the API to manage your hooks without using &lt;code&gt;wombat&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;figure class="tmblr-full" data-orig-height="114" data-orig-width="932" data-orig-src="https://cldup.com/B1UqaIbV7V.png"&gt;&lt;img src="http://68.media.tumblr.com/e50b893fcb6153ae09cf3c6829d2010d/tumblr_inline_o83v3dvM4t1qa1p6q_540.png" alt="a package publication" data-orig-height="114" data-orig-width="932" data-orig-src="https://cldup.com/B1UqaIbV7V.png"/&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;h2&gt;Why?&lt;/h2&gt;

&lt;p&gt;You can use hooks to trigger integration testing, trigger a deploy, make an announcement in a chat channel, or trigger an update of your own packages.&lt;/p&gt;

&lt;p&gt;To get you started, here are some of the things we’ve built while developing hooks for you:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;a href="https://www.npmjs.com/package/npm-hook-receiver"&gt;npm-hook-receiver&lt;/a&gt;: an example receiver that creates a &lt;a href="https://www.npmjs.com/package/restify"&gt;restify&lt;/a&gt; server to listen for hook HTTP posts. &lt;a href="https://github.com/npm/npm-hook-receiver"&gt;Source code&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/npm/npm-hook-slack"&gt;npm-hook-slack&lt;/a&gt;: the world’s simplest Slackbot for reporting package events to Slack; built on &lt;code&gt;npm-hook-receiver&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/npm/captain-hook"&gt;captain-hook&lt;/a&gt;: a much more interesting Slackbot that lets you manage your webhooks as well as receive the posts.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.npmjs.com/package/wombat"&gt;wombat&lt;/a&gt;: a CLI tool for inspecting and editing your hooks. This client exercises the full hooks API. &lt;a href="https://github.com/npm/wombat-cli"&gt;Source code&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/npm/ifttt-hook-translator"&gt;ifttt-hook-translator&lt;/a&gt;: Code to receive a webhook and translate it to an &lt;a href="https://ifttt.com/"&gt;IFTTT&lt;/a&gt; event, which you can then use to trigger anything else you can do on IFTTT.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/bcoe/citgm-harness/pulls"&gt;citgm-harness&lt;/a&gt;: This is a proof-of-concept of how node.js’s &lt;a href="https://github.com/nodejs/citgm"&gt;Canary in the Gold Mine suite&lt;/a&gt; might use hooks to drive its package tests. Specific package publications trigger continuous integration testing of a different project, which is one way to test that you haven’t broken your downstream dependents.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;figure class="tmblr-full" data-orig-height="87" data-orig-width="361" data-orig-src="https://cldup.com/SrpybEVdc0.png"&gt;&lt;img src="http://68.media.tumblr.com/61f9fad5d7a2892623db247360196aa6/tumblr_inline_o83v3djzXV1qa1p6q_540.png" alt="starring" data-orig-height="87" data-orig-width="361" data-orig-src="https://cldup.com/SrpybEVdc0.png"/&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;h2&gt;What do you think?&lt;/h2&gt;

&lt;p&gt;We’re releasing hooks as a beta, and where we take it from here is up to you. What do you think about it? Are there other events you’d like to watch? Is 100 hooks just right, too many, or not enough?&lt;/p&gt;

&lt;p&gt;We’re really (really) (really) interested to see what you come up with. If you build something useful (or silly) using hooks, don’t be shy to &lt;a href="http://info@npmjs.com"&gt;drop us a line&lt;/a&gt; or poke us &lt;a href="https://twitter.com/npmjs"&gt;on Twitter&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;What’s next?&lt;/h2&gt;

&lt;p&gt;This is the tip of an excitement iceberg — &lt;em&gt;exciteberg&lt;/em&gt;, if you will — of cool new ways to use npm. Watch this space!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;npm ♥ you!&lt;/em&gt;&lt;/p&gt;</description><link>http://blog.npmjs.org/post/145260155635</link><guid>http://blog.npmjs.org/post/145260155635</guid><pubDate>Wed, 01 Jun 2016 08:52:55 -0700</pubDate><dc:creator>ceejbot</dc:creator></item><item><title>Announcing npm for Atlassian Bitbucket Pipelines and an improved Bitbucket Connect add-on</title><description>&lt;p&gt;&lt;img src="https://assets.npmjs.com/uploads/2016/05/npm-wombat-very-excited-by-Atlassian-Bitbucket-Pipelines-and-you-will-be-too.png" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;The 283,000 (!) packages in the npm Registry are only useful if it’s easy for developers to integrate them into their projects and deploy their code, so we’re excited by any chance to streamline your workflow.&lt;/p&gt;

&lt;p&gt;If you work with &lt;a href="https://bitbucket.org?utm_source=npm&amp;amp;utm_medium=press-release&amp;amp;utm_campaign=bitbucket_bitbucket-pipelines"&gt;Bitbucket&lt;/a&gt;, starting today, it’s easier than ever to install and publish npm private packages — to either your npm account or your self-hosted npm Enterprise installation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://bitbucket.org/product/features/pipelines?utm_source=npm&amp;amp;utm_medium=press-release&amp;amp;utm_campaign=bitbucket_bitbucket-pipelines"&gt;Bitbucket Pipelines&lt;/a&gt; is a new continuous integration service built into Bitbucket Cloud for end-to-end visibility, from coding to deployment. We’re excited that they’re launching with npm support.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;strong&gt;When it’s easier to work with packages, developers do.&lt;/strong&gt; This integration helps split monolithic projects into multiple npm modules. More, smaller packages means code discovery and re-use, which saves you from reinventing the wheel.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It’s all in one place.&lt;/strong&gt; See pipeline information and work with npm right in Bitbucket commits, branches, and PRs, without context switching and waiting for feedback to see if you broke a build.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;You can automate tedious parts of the development workflow.&lt;/strong&gt; (Did you write a test for that?…)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It’s easy.&lt;/strong&gt; To get started, just add a build configuration file into a Bitbucket repo.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;How?…&lt;/p&gt;

&lt;h3&gt;Working with private packages in the npm registry&lt;/h3&gt;

&lt;ol&gt;&lt;li&gt;Use the &lt;code&gt;bitbucket-pipelines.yml&lt;/code&gt; supplied in &lt;a href="https://bitbucket.org/benjamincoe/private-modules-demo/src"&gt;this repository&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Set the &lt;code&gt;NPM_TOKEN&lt;/code&gt; environment variable.

&lt;ul&gt;&lt;li&gt;This token can be found in your local &lt;code&gt;~/.npmrc&lt;/code&gt;, after you log in to the registry.&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Enable pipelines&lt;/li&gt;
&lt;/ol&gt;&lt;h3&gt;Working with private packages in npm Enterprise&lt;/h3&gt;

&lt;ol&gt;&lt;li&gt;Use the &lt;code&gt;bitbucket-pipelines.yml&lt;/code&gt; supplied in &lt;a href="https://bitbucket.org/benjamincoe/private-modules-demo/src"&gt;this repository&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Set the &lt;code&gt;NPM_TOKEN&lt;/code&gt; environment variable:

&lt;ul&gt;&lt;li&gt;This token can be found in your local &lt;code&gt;~/.npmrc&lt;/code&gt;, after you log in to the registry.&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Set &lt;code&gt;NPM_REGISTRY_URL&lt;/code&gt; to the full URL of your private registry (with scheme).&lt;/li&gt;
&lt;li&gt;Enable pipelines.&lt;/li&gt;
&lt;/ol&gt;&lt;h2&gt;New in the Bitbucket Connect add-on: private packages&lt;/h2&gt;

&lt;p&gt;Alongside the new pipelines integration, the &lt;a href="https://developer.atlassian.com/blog/2016/01/bitbucket-npm-integration/?utm_source=npm&amp;amp;utm_medium=press-release&amp;amp;utm_campaign=bitbucket_bitbucket-pipelines"&gt;npm for Bitbucket add-on&lt;/a&gt; has been updated to support private modules.&lt;/p&gt;

&lt;p&gt;This helps complete an elegant CI/CD workflow:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;Bitbucket Pipelines installs your private and public npm modules, ensuring that your build continues passing;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://bitbucket-npm.aerobatic.io/"&gt;npm for Bitbucket Cloud&lt;/a&gt; provides constant feedback, ensuring that an up-to-date version of your module has been published.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Get started by &lt;a href="https://bitbucket.org/site/addons/authorize?descriptor_uri=https://bitbucket-npm.aerobatic.io/connect.json&amp;amp;redirect_uri=https://bitbucket-npm.aerobatic.io/"&gt;installing the add-on now&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Now what?&lt;/h2&gt;

&lt;p&gt;We have more exciting integrations and improvements in the … pipeline (sorry), but it helps to know what matters to you. Don’t be shy to share feedback in the comments or hit us up &lt;a href="https://twitter.com/npmjs"&gt;on Twitter&lt;/a&gt;.&lt;/p&gt;</description><link>http://blog.npmjs.org/post/144855273708</link><guid>http://blog.npmjs.org/post/144855273708</guid><pubDate>Tue, 24 May 2016 06:00:45 -0700</pubDate><dc:creator>bencoe</dc:creator></item><item><title>running npm Enterprise on Google Compute Engine</title><description>&lt;p&gt;Last month, we released a “one-click” installer for &lt;a href="http://blog.npmjs.org/post/142409778875/run-npm-enterprise-on-aws-with-just-a-few-clicks" target="_blank"&gt;npm Enterprise on AWS&lt;/a&gt;. Fresh on its heels, we’re excited to announce support for &lt;a href="https://cloud.google.com/compute/" target="_blank"&gt;Google Compute Engine&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Getting npm Enterprise up and running on GCE is easy:&lt;/p&gt;

&lt;h2&gt;Install and configure the Google Cloud SDK&lt;/h2&gt;

&lt;ul&gt;&lt;li&gt;Download the &lt;a href="https://cloud.google.com/sdk/#Quick_Start" target="_blank"&gt;Google Cloud SDK&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Authenticate: &lt;code&gt;gcloud auth login&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Configure your project and default zone:

&lt;ul&gt;&lt;li&gt;&lt;code&gt;gcloud config set project my-project&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;gcloud config set compute/zone us-east1-d&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h2&gt;Run the npm Enterprise deploy template&lt;/h2&gt;

&lt;ul&gt;&lt;li&gt;&lt;p&gt;Fetch npm’s configuration template:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;code&gt;curl -XGET &lt;a href="https://raw.githubusercontent.com/npm/npme-installer/master/npme-gce.jinja"&gt;https://raw.githubusercontent.com/npm/npme-installer/master/npme-gce.jinja&lt;/a&gt; &amp;gt; /tmp/npme-gce.jinja&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run the npm Enterprise deploy template:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;code&gt;gcloud deployment-manager deployments create npme-deployment --config /tmp/npme-gce.jinja --properties="zone=us-east1-d"&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;em&gt;Note: You can replace &lt;code&gt;us-east1-d&lt;/code&gt; with whatever zone you’d like to deploy to.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;Go grab a coffee&lt;/h2&gt;

&lt;p&gt;When you get back, if you visit your cloud console you’ll see a running server called &lt;code&gt;npm-enterprise&lt;/code&gt;. That’s all there is to it!&lt;/p&gt;

&lt;h2&gt;Configure your instance&lt;/h2&gt;

&lt;p&gt;You can configure your instance by visiting
port &lt;code&gt;8800&lt;/code&gt;. Our &lt;a href="https://docs.npmjs.com/enterprise/index" target="_blank"&gt;npm Enterprise&lt;/a&gt; will point you in the right direction with information on the various settings that you can configure.&lt;/p&gt;

&lt;h2&gt;What’s next?&lt;/h2&gt;

&lt;p&gt;It’s our continued goal to make npm Enterprise painless to run, regardless of your infrastructure. Are we missing a platform that you’d love for us to support? Let us know in the comments.&lt;/p&gt;</description><link>http://blog.npmjs.org/post/143790824382</link><guid>http://blog.npmjs.org/post/143790824382</guid><pubDate>Tue, 03 May 2016 07:01:02 -0700</pubDate><dc:creator>bencoe</dc:creator></item><item><title>how many npm users are there?</title><description>&lt;h2&gt;A story in 6 graphs&lt;/h2&gt;

&lt;p&gt;How many npm users are there? It&amp;rsquo;s a surprisingly tricky question.&lt;/p&gt;

&lt;p&gt;There are a little over 211,000 registered npm users, of whom about 73,000 have published packages. But far more people than that use npm: most things npm does do not require you to login or register. So how many are there, and what are they up to? Our first and most obvious clue is the number of packages they are downloading:&lt;/p&gt;

&lt;h3&gt;How many packages are downloaded?&lt;/h3&gt;

&lt;p&gt;&lt;img src="https://cloud.githubusercontent.com/assets/185893/14835901/412a8096-0bc1-11e6-9b2a-fb1b3c9b3973.png" alt="package downloads per week passed 1 billion in April"/&gt;&lt;/p&gt;

&lt;p&gt;That&amp;rsquo;s over a billion downloads &lt;em&gt;per week&lt;/em&gt;, and that only counts package installs that weren&amp;rsquo;t already in cache &amp;ndash; about 66% of npm package installs don&amp;rsquo;t require downloading any packages, because they fetch from the &lt;a href="https://docs.npmjs.com/cli/cache"&gt;cache&lt;/a&gt;. Still, the growth is truly, without exaggeration, exponential.&lt;/p&gt;

&lt;p&gt;So what&amp;rsquo;s driving all the downloads? Are the same people building ever-more-complicated applications, downloading more packages to do it? Are the same people running build servers over and over? Or are there actually more people? Our next clue comes from the number of unique IPs hitting the registry:&lt;/p&gt;

&lt;h3&gt;How many IPs hit the registry?&lt;/h3&gt;

&lt;p&gt;&lt;img src="https://cloud.githubusercontent.com/assets/185893/14836176/0bbeeb34-0bc3-11e6-8572-59b72251cb88.png" alt="3.1MM unique IPs hit the registry in March"/&gt;&lt;/p&gt;

&lt;p&gt;Here&amp;rsquo;s a ton of growth again, close to 100% growth year-on-year, but much more linear than the downloads: 3.1 million IPs hit the registry in March. Of course, &lt;a href="https://en.wikipedia.org/wiki/Wikipedia:IP_addresses_are_not_people"&gt;IP addresses are not people&lt;/a&gt;. Some of these IPs are build servers and other robots. Other IP addresses are companies or educational institions that serve thousands or even tens of thousands of people. So while it doesn&amp;rsquo;t correlate perfectly, generally speaking, more IPs means more people are using npm.&lt;/p&gt;

&lt;h3&gt;How many times does npm get run?&lt;/h3&gt;

&lt;p&gt;&lt;img src="https://cloud.githubusercontent.com/assets/185893/14836178/130501bc-0bc3-11e6-8bfc-32ec0b74ad47.png" alt="unique sessions"/&gt;&lt;/p&gt;

&lt;p&gt;Every time npm runs it generates a unique ID that it sends as a header for every request it makes during that run. This ID is random and not tied to you in any way, and once npm finishes running it is deleted. We use this ID for debugging the registry: it lets us see that these 5, 10 or 50 requests were all part of the same operation, which makes it easier to see what&amp;rsquo;s going on when somebody has a problem. It also makes it possible to say roughly how many times npm is run &amp;ndash; or at least, run in a way that makes a request to the registry. There were 84 million npm sessions in March: this number is growing faster than IPs, but less quickly than downloads.&lt;/p&gt;

&lt;p&gt;We can take these last two and combine them:&lt;/p&gt;

&lt;h2&gt;How many packages per npm run?&lt;/h2&gt;

&lt;p&gt;&lt;img src="https://cloud.githubusercontent.com/assets/185893/14836179/192f2e78-0bc3-11e6-8f01-d3590efd53cf.png" alt="downloads per session"/&gt;&lt;/p&gt;

&lt;p&gt;This number is interesting because it&amp;rsquo;s not going anywhere. The ratio of packages downloaded to npm sessions is essentially constant (this is not the same as the number of packages downloaded per install, because many npm sessions don&amp;rsquo;t result in downloads). But this is a clear signal: the number of packages per install isn&amp;rsquo;t rising. Applications aren&amp;rsquo;t getting notably more complicated; people are installing packages more often because they are writing more applications.&lt;/p&gt;

&lt;p&gt;Here&amp;rsquo;s a final clue:&lt;/p&gt;

&lt;h3&gt;How many packages per IP?&lt;/h3&gt;

&lt;p&gt;&lt;img src="https://cloud.githubusercontent.com/assets/185893/14836183/20f7fffe-0bc3-11e6-9220-e6d34f5efe15.png" alt="downloads per IP"/&gt;&lt;/p&gt;

&lt;p&gt;The number of packages downloaded by an IP is also rising linearly. So, not only are more people using npm, but the people who are already using npm are using it more and more frequently. And then of course there&amp;rsquo;s this number:&lt;/p&gt;

&lt;h3&gt;Web users&lt;/h3&gt;

&lt;p&gt;&lt;img src="https://cloud.githubusercontent.com/assets/185893/14836193/2d3c9dba-0bc3-11e6-8fbc-fb8cb755006f.png" alt="unique web users"/&gt;&lt;/p&gt;

&lt;p&gt;Another way of counting npm users is counting people who visit npm&amp;rsquo;s website. This also grew enormously; 400% since we started the company. In the last 90 days, npm saw just over 4 million unique users visit our site. Ordinarily, you take web user numbers with a grain of salt &amp;ndash; there&amp;rsquo;s lots of ways they can be wrong. But combined with the IPs, the sessions, and the download numbers, we think that number is probably accurate, maybe even a little conservative.&lt;/p&gt;

&lt;h3&gt;Invisible users&lt;/h3&gt;

&lt;p&gt;There are so many sources of error! There are robots who crawl the registry. There are lots of companies who host their own internal registry caches, or run &lt;a href="https://www.npmjs.com/enterprise"&gt;npm Enterprise&lt;/a&gt;, and so have their own npm website and registry and never hit ours. There&amp;rsquo;s the entire nation of China, which finds it difficult to access npm through the great firewall, and is served by our hard-working friends at &lt;a href="https://cnpmjs.org/"&gt;cnpmjs&lt;/a&gt;. There&amp;rsquo;s errors that inflate our numbers, and errors that deflate them. If you think we&amp;rsquo;re way off, let us know. But we think we have enough for a good guess.&lt;/p&gt;

&lt;h3&gt;4 million npm users&lt;/h3&gt;

&lt;p&gt;We think there are four million npm users, and we think that number is doubling every year. Over at the node.js foundation, they see &lt;a href="https://www.youtube.com/watch?v=nHOTBiuAxtU&amp;amp;feature=youtu.be&amp;amp;t=4m12s"&gt;similar growth numbers&lt;/a&gt;. Not only are there more of them, but they&amp;rsquo;re more engaged than ever before. This is awesome! The &lt;a href="https://twitter.com/seldo/status/725040729001611264"&gt;25 very hard working people of npm Inc.&lt;/a&gt; thank you for your participation and your contributions to the community, and we hope to see even more of you.&lt;/p&gt;</description><link>http://blog.npmjs.org/post/143451680695</link><guid>http://blog.npmjs.org/post/143451680695</guid><pubDate>Tue, 26 Apr 2016 16:07:46 -0700</pubDate><category>stats</category><dc:creator>seldo</dc:creator></item><item><title>run npm Enterprise on AWS with just a few clicks</title><description>&lt;p&gt;In a &lt;a href="http://blog.npmjs.org/post/138936231510/running-npm-on-site-in-aws"&gt;previous blog post&lt;/a&gt; we showed you how easy it is to run npm Enterprise on Amazon Web Services. Today, we’re happy to announce the public availability of the npm Enterprise Amazon Machine Image (AMI). Now, it’s even easier to run your own private npm registry and website on AWS!&lt;/p&gt;

&lt;p&gt;Using our AMI, there is nothing to install. Just launch an instance, configure it using the npm Enterprise admin web UI, and you’re done: it’s a true point-and-click solution for sharing and managing private JavaScript packages within your company.&lt;/p&gt;

&lt;p&gt;Let’s take a quick look at the details.&lt;/p&gt;

&lt;h2&gt;1. Find the AMI in your preferred AWS region&lt;/h2&gt;

&lt;p&gt;We have AMIs for several AWS regions. When you launch a new instance in the AWS EC2 Console, find the right one by searching for the relevant AMI ID under the &lt;em&gt;Community AMIs&lt;/em&gt; tab. Note that new AMI versions are published about every month and include the date of publication in the AMI name.&lt;/p&gt;

&lt;p&gt;Here’s a list of the AMI IDs by region:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;code&gt;us-east-1&lt;/code&gt; (N. Virginia): &lt;code&gt;ami-edd65bfa&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;us-west-1&lt;/code&gt; (N. California): &lt;code&gt;ami-61db9d01&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;us-west-2&lt;/code&gt; (Oregon): &lt;code&gt;ami-dc34f6bc&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;eu-central-1&lt;/code&gt; (Frankfurt): &lt;code&gt;ami-5ec13431&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ap-southeast-2&lt;/code&gt; (Sydney): &lt;code&gt;ami-7d32181e&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Ensure the AMI comes from owner &lt;code&gt;666882590071&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you don’t see your preferred region in the list above, &lt;a href="https://www.npmjs.com/support"&gt;contact our support team&lt;/a&gt;, and we’ll get one created for you!&lt;/p&gt;

&lt;p&gt;&lt;img src="https://cloud.githubusercontent.com/assets/1929625/16884406/297760bc-4a97-11e6-9aa7-4cc7ed9a44c1.png" alt="Search in Community AMIs"/&gt;&lt;/p&gt;

&lt;h2&gt;2. Launch it&lt;/h2&gt;

&lt;p&gt;When you launch an instance of the AMI, you’ll need to:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;Choose an instance type: use &lt;code&gt;m3.large&lt;/code&gt; or better&lt;/li&gt;
&lt;li&gt;Enter a storage size: must be at least 16 GB; we recommend 50-100 GB for typical installs&lt;/li&gt;
&lt;li&gt;Select or create a security group: open ports &lt;code&gt;22&lt;/code&gt; (ssh), &lt;code&gt;8080&lt;/code&gt; (registry), &lt;code&gt;8081&lt;/code&gt; (website), and &lt;code&gt;8800&lt;/code&gt; (npm Enterprise admin UI)&lt;/li&gt;
&lt;li&gt;Select or create a &lt;code&gt;.pem&lt;/code&gt; key pair: this allows you to &lt;code&gt;ssh&lt;/code&gt; into your server instance&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;It’s not necessary, but if you’d prefer to attach an EBS volume for registry data that is separate from the root volume, you can. However, the root EBS volume cannot be smaller than 16 GB.&lt;/p&gt;

&lt;p&gt;For more information (or screenshots) on any of the above, see our docs for &lt;a href="https://docs.npmjs.com/enterprise/running-on-aws"&gt;Running npm Enterprise in AWS&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;3. Configure and start the appliance&lt;/h2&gt;

&lt;p&gt;You don’t have to, but you can &lt;code&gt;ssh&lt;/code&gt; into your EC2 instance to make sure it’s up and running. If you do, you should see a welcome message like the following:&lt;/p&gt;

&lt;p&gt;&lt;img width="532" alt="Terminal welcome message" src="https://cloud.githubusercontent.com/assets/1929625/16884411/3008d0be-4a97-11e6-9b7a-274db7f675e5.png"/&gt;&lt;/p&gt;

&lt;p&gt;Open your favorite web browser, access your server on port &lt;code&gt;8800&lt;/code&gt;, and follow the prompts to configure and start your appliance.&lt;/p&gt;

&lt;p&gt;You’ll need a license key. If you haven’t already purchased one, you can &lt;a href="https://www.npmjs.com/on-site#free-trial"&gt;get a free trial key here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For more information on configuring npm Enterprise, &lt;a href="https://docs.npmjs.com/enterprise/installation#3-configure-your-installation-via-the-admin-web-console"&gt;visit our docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;That’s it! Once you’ve configured and started the appliance, your private npm registry and website are ready for use. See &lt;a href="https://docs.npmjs.com/enterprise/client-configuration"&gt;this document&lt;/a&gt; for configuring your npm CLI to use your new private registry.&lt;/p&gt;

&lt;p&gt;We’re continually striving to provide you the best solutions for distributing, discovering, and reusing your JavaScript code and packages. We hope this AMI makes it just that much easier to leverage the same tools within your organization that work so well in open source communities around the world - a concept we refer to as &lt;a href="http://blog.npmjs.org/post/139373244435/practices-perfected-in-oss-can-reshape-enterprise"&gt;InnerSource&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;As always, if you have questions or feedback, please &lt;a href="https://www.npmjs.com/support"&gt;reach out&lt;/a&gt;.&lt;/p&gt;</description><link>http://blog.npmjs.org/post/142409778875</link><guid>http://blog.npmjs.org/post/142409778875</guid><pubDate>Thu, 07 Apr 2016 09:02:16 -0700</pubDate><category>aws</category><category>innersource</category><category>enterprise</category><dc:creator>nexdrew</dc:creator></item><item><title>npm registry is now fully HTTPS!</title><description>&lt;p&gt;Effective yesterday morning, all requests to the npm registry are made via &lt;code&gt;HTTPS&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;What’s different&lt;/h2&gt;

&lt;ul&gt;&lt;li&gt;npm has accepted HTTPS or HTTP requests for some time. (In fact, only the initial hop from your client to Fastly, our CDN, would use HTTP.) We returned most data to you via HTTPS, but we would serve JSON containing package metadata over HTTP if you requested it via HTTP.&lt;/li&gt;
&lt;li&gt;Starting today, requests you make to the registry over HTTP still work, but we will return &lt;em&gt;all&lt;/em&gt; data via HTTPS.&lt;/li&gt;
&lt;li&gt;In a few weeks, Fastly will redirect all HTTP requests to HTTPS. This won’t break your HTTP requests, but they’ll be a bit slower because of the redirect. You will be able to avoid that delay by using HTTPS in your first request.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Practically this means:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;If you request &lt;code&gt;&lt;a href="http://registry.npmjs.org/pkgname"&gt;http://registry.npmjs.org/pkgname&lt;/a&gt;&lt;/code&gt; you get a JSON response&lt;/li&gt;
&lt;li&gt;That JSON &lt;strong&gt;used to&lt;/strong&gt; include &lt;code&gt;&lt;a href="http://registry.npmjs.org/pkgname/-/pkgname-1.2.3.tgz"&gt;http://registry.npmjs.org/pkgname/-/pkgname-1.2.3.tgz&lt;/a&gt;&lt;/code&gt;&lt;br/&gt;
Now it’s &lt;strong&gt;https&lt;/strong&gt; for the dist.tarball url, &lt;code&gt;&lt;a href="https://registry.npmjs.org/pkgname/-/pkgname-1.2.3.tgz"&gt;https://registry.npmjs.org/pkgname/-/pkgname-1.2.3.tgz&lt;/a&gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Soon&lt;/em&gt;, a request to &lt;code&gt;&lt;a href="http://registry.npmjs.org/pkgname"&gt;http://registry.npmjs.org/pkgname&lt;/a&gt;&lt;/code&gt; will 301 (redirect) over to &lt;code&gt;&lt;a href="https://registry.npmjs.org/pkgname"&gt;https://registry.npmjs.org/pkgname&lt;/a&gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h2&gt;Does this mean that package data is/was insecure?&lt;/h2&gt;

&lt;p&gt;No! The CLI client checks a &lt;a href="https://en.wikipedia.org/wiki/Sha1sum"&gt;shashum&lt;/a&gt; to verify the package and that check always has been over HTTPS.&lt;/p&gt;

&lt;h2&gt;How it affects you&lt;/h2&gt;

&lt;ul&gt;&lt;li&gt;It probably doesn’t. However, a small number of users currently replicate registry data using third-party tools such as Artifactory with configurations to only communicate insecurely.&lt;/li&gt;
&lt;li&gt;This is easily fixed by reconfiguring your tool, or by replicating the npm registry using another method.&lt;/li&gt;
&lt;/ul&gt;&lt;h2&gt;How to weather these changes&lt;/h2&gt;

&lt;p&gt;We’ve developed an ecosystem of tools that you can use to replicate the registry in a way that is resilient to these changes:&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;_changes&lt;/code&gt; &lt;strong&gt;feed&lt;/strong&gt;: &lt;a href="https://skimdb.npmjs.com/registry/_changes?descending=true&amp;amp;limit=10"&gt;https://skimdb.npmjs.com/registry/_changes?descending=true&amp;amp;limit=10&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For every change in a package in the registry, the whole package object (with changes) gets emitted as data on the &lt;code&gt;_changes&lt;/code&gt; feed of CouchDB.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;follower&lt;/strong&gt;: &lt;a href="https://github.com/npm/concurrent-couch-follower"&gt;https://github.com/npm/concurrent-couch-follower&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Users wishing to follow the changes feed can use our CouchDB follower wrapper, which will ensure you don&amp;rsquo;t miss any documents even if you process them asynchronously.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;normalizer&lt;/strong&gt;: &lt;a href="https://github.com/npm/normalize-registry-metadata"&gt;https://github.com/npm/normalize-registry-metadata&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, we also provide a normalizer, so that you can clean up the data you receive, and implement the changes from the changes feed.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;&lt;strong&gt;We will never stop making replicating public packages utterly trivial. If anything, we’ll keep making it easier.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We believe these tools should minimize any disruption from our transition to HTTPS — but of course there are edge cases! If you experience difficulty, we want to hear about it and help you out. As always, don’t be shy to reach out: support@npmjs.com.&lt;/p&gt;

&lt;p&gt;Happy replicating!&lt;/p&gt;</description><link>http://blog.npmjs.org/post/142077474335</link><guid>http://blog.npmjs.org/post/142077474335</guid><pubDate>Fri, 01 Apr 2016 10:42:29 -0700</pubDate><dc:creator>agdubs</dc:creator></item><item><title>fixing a bearer token vulnerability</title><description>&lt;p&gt;Last week, &lt;a href="https://github.com/npm/npm/commit/fea8cc92cee02c720b58f95f14d315507ccad401"&gt;&lt;code&gt;npm@2.15.1&lt;/code&gt;&lt;/a&gt; (npm LTS) and &lt;a href="https://github.com/npm/npm/commit/f67ecad59e99a03e5aad8e93cd1a086ae087cb29"&gt;&lt;code&gt;npm@3.8.3&lt;/code&gt;&lt;/a&gt; were released to &lt;code&gt;latest&lt;/code&gt;. Among other improvements, these fix a vulnerability that could cause the unintentional leakage of bearer tokens.&lt;/p&gt;

&lt;p&gt;Here are details on this vulnerability and how it affects you.&lt;/p&gt;

&lt;h2&gt;How to update npm&lt;/h2&gt;

&lt;p&gt;An up to date npm is the most secure npm. Update npm to get this patch, as well as other patches:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install npm@latest -g&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;Think you&amp;rsquo;re at risk? Generate a new bearer token&lt;/h2&gt;

&lt;p&gt;If you believe that your bearer token may have been leaked, &lt;a href="https://www.npmjs.com/settings/tokens"&gt;invalidate your current npm bearer tokens&lt;/a&gt; and rerun &lt;code&gt;npm login&lt;/code&gt; to generate new tokens. Keep in mind that this may cause continuous integration builds in services like Travis to break, in which case you’ll need to update the tokens in your CI server’s configuration.&lt;/p&gt;

&lt;h2&gt;Details of the vulnerability&lt;/h2&gt;

&lt;p&gt;Since 2014, npm’s registry has used HTTP bearer tokens to authenticate requests from the npm’s command-line interface. A design flaw meant that the CLI was sending these bearer tokens with &lt;em&gt;every&lt;/em&gt; request made by logged-in users, regardless of the destination of their request. (The bearers only should have been included for requests made against a registry or registries used for the current install.)&lt;/p&gt;

&lt;p&gt;An attacker could exploit this flaw by setting up an HTTP server that could collect authentication information, then use this authentication information to impersonate the users whose tokens they collected. This impersonation would allow them to do anything the compromised users could do, including publishing new versions of packages.&lt;/p&gt;

&lt;p&gt;With the fixes we’ve released, the CLI will only send bearer tokens with requests made against a registry.&lt;/p&gt;

&lt;h2&gt;Will this break my current setup?&lt;/h2&gt;

&lt;p&gt;Maybe.&lt;/p&gt;

&lt;p&gt;npm’s CLI team believes that the fix won’t break any existing registry setups. Due to the large number of registry software suites out in the wild, though, it’s possible our change will be breaking in some cases.&lt;/p&gt;

&lt;p&gt;If so, please &lt;a href="https://github.com/npm/npm/issues/new"&gt;file an issue&lt;/a&gt; describing the software you’re using and how it broke. Our team will work with you to mitigate the breakage.&lt;/p&gt;

&lt;h2&gt;Thanks to the community&lt;/h2&gt;

&lt;p&gt;Thanks to Mitar, Will White &amp;amp; the team at Mapbox, Max Motovilov, and James Taylor for reporting this vulnerability to npm. You can learn more about npm’s security policy on &lt;a href="https://www.npmjs.com/policies/security"&gt;our security page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;-/-&lt;/p&gt;

&lt;p&gt;Node.js has also posted about this disclosure. You can read that &lt;a href="http://nodejs.org/en/blog/vulnerability/npm-tokens-leak-march-2016/"&gt;here&lt;/a&gt;.&lt;/p&gt;</description><link>http://blog.npmjs.org/post/142036323955</link><guid>http://blog.npmjs.org/post/142036323955</guid><pubDate>Thu, 31 Mar 2016 15:54:32 -0700</pubDate><dc:creator>agdubs</dc:creator></item><item><title>on dependency squatter packages</title><description>&lt;p&gt;This week, after we &lt;a href="http://blog.npmjs.org/post/141905368000/changes-to-npms-unpublish-policy"&gt;announced changes to our unpublish policy&lt;/a&gt;, some community members created a series of packages that depend on every package in the registry. Functionally, these packages exist to ensure that every package has at least one dependent package. A full list of these packages is &lt;a href="https://gist.github.com/isaacs/c079dea172e007e31b8a9174d3e1cedb"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Other members of the community quickly notified us of these packages. In response, &lt;strong&gt;we have contacted the authors of these packages&lt;/strong&gt; and we are &lt;strong&gt;removing all of these packages from the registry&lt;/strong&gt;, effective 6:00pm PST today (March 30, 2016).&lt;/p&gt;

&lt;p&gt;All of the authors we contacted were cooperative and acted in good faith to our requests :) This is not a fight- we&amp;rsquo;re communicating this situation for the sake of transparency, not drama.&lt;/p&gt;

&lt;p&gt;Here&amp;rsquo;s why we’ve taken this step:&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;&lt;strong&gt;These packages violate npm&amp;rsquo;s &lt;a href="https://www.npmjs.com/policies/terms"&gt;Terms of Use&lt;/a&gt;.&lt;/strong&gt; 
Much like a squatter package, packages like these have no individual functionality beyond depending on other packages.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;These packages perpetuate a misunderstanding of our updated unpublish policy.&lt;/strong&gt;
Some community members are concerned that packages like these make unpublishing packages completely impossible after the new 24 hour window, but this is not the case. These packages violate npm’s terms of use, so they aren’t valid package dependents. Having them alone wouldn’t make it impossible to unpublish a package — meaning the exercise doesn’t even meet its intended goal.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;These packages are harmful.&lt;/strong&gt;
If an npm user were to try to install one of them, the installation most likely would fail. Worse, there’s the small chance that installing would succeed … in filling up their hard drive with a lot of junk, and spinning their CPU for a very long time. We can’t guarantee the safety or security of all packages in the registry, but when we learn about packages with harmful effects like these, we have a responsibility to act to protect the community.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;We utterly depend on our community — for making the npm registry useful and safe for everyone, and for helping us make policies that balance everyone’s needs and keep everyone safe. We’re grateful to everyone who reached out to alert us to these packages — honestly, thank you! — and we’re also open to continue discussing it with you to understand your concerns. If you have concerns or questions, please contact &lt;a href="mailto:community@npmjs.com"&gt;community@npmjs.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gist.github.com/ashleygwilliams/ddb3700f215664687dbc1f7bdf5ec060"&gt;Here&lt;/a&gt; is the email we sent to the authors of these packages.&lt;/p&gt;</description><link>http://blog.npmjs.org/post/141985926180</link><guid>http://blog.npmjs.org/post/141985926180</guid><pubDate>Wed, 30 Mar 2016 18:06:06 -0700</pubDate><dc:creator>agdubs</dc:creator></item><item><title>changes to npm’s unpublish policy</title><description>&lt;p&gt;One of Node.js’ core strengths is the community’s trust in npm’s registry. As it’s grown, the registry has filled with packages that are more and more interconnected.&lt;/p&gt;

&lt;p&gt;A byproduct of being so interdependent is that a single actor can wreak significant havoc across the ecosystem. If a publisher unpublishes a package that others depend upon, this breaks every downstream project that depends upon it, possibly thousands of projects.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blog.npmjs.org/post/141577284765/kik-left-pad-and-npm"&gt;Last Tuesday’s events&lt;/a&gt; revealed that this danger isn’t just hypothetical, and it’s one for which we already should have been prepared. It’s our mission to help the community succeed, and by failing to protect the community, we didn’t uphold that mission.&lt;/p&gt;

&lt;p&gt;We’re sorry.&lt;/p&gt;

&lt;p&gt;This week, we’ve seen a lot of discussion about why &lt;code&gt;unpublish&lt;/code&gt; exists at all. Similar discussions happen within npm, Inc. There are important and legitmate reasons for the feature, so we have no intention of removing it, but now we’re significantly changing how &lt;code&gt;unpublish&lt;/code&gt; behaves and the policies that surround it.&lt;/p&gt;

&lt;p&gt;These changes, which incorporate helpful feedback from a lot of community members, are intended to ensure that events like Tuesday’s don’t happen again.&lt;/p&gt;

&lt;h2&gt;Our new policy&lt;/h2&gt;

&lt;p&gt;Going forward, if you try to unpublish a given &lt;code&gt;package@version&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;p&gt;If the version is less than 24 hours old, you can unpublish it. The
package will be completely removed from the registry. No new
packages can be published using the same name and version.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If the version is older than 24 hours, then the unpublish will fail, with a message to contact support@npmjs.com.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you contact support, they will check to see if removing that version of your package would break any other installs. If so, we will not remove it. You’ll either have to transfer ownership of the package or reach out to the owners of dependent packages to change their dependency.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If every version of a package is removed, it will be replaced with a &lt;a href="https://github.com/npm/security-holder"&gt;security placeholder package&lt;/a&gt;, so that the formerly used name will not be susceptible to malicious squatting.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If another member of the community wishes to publish a package with the same name as a security placeholder, they’ll need to contact &lt;code&gt;support@npmjs.com&lt;/code&gt;.  npm will determine whether to grant this request. (Generally, we will.)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h2&gt;Examples&lt;/h2&gt;

&lt;p&gt;This can be a bit difficult to understand in the abstract. Let’s walk
through some examples.&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;&lt;p&gt;Brenna is a maintainer of a popular package named “supertools”. Supertools has 3 published versions: &lt;code&gt;0.0.1&lt;/code&gt;, &lt;code&gt;0.3.0&lt;/code&gt;, and &lt;code&gt;0.3.1&lt;/code&gt;. Many packages depend on all the versions of supertools, and, across all versions, supertools gets around 2 million downloads a month.&lt;/p&gt;

&lt;p&gt;Brenna does a huge refactor and publishes &lt;code&gt;1.0.0&lt;/code&gt;. An hour later, she realizes that there is a huge vulnerability in the project and needs to unpublish. Version &lt;code&gt;1.0.0&lt;/code&gt; is less than 24 hours old. Brenna is able to unpublish version &lt;code&gt;1.0.0&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Embarrassed, Brenna wants to unpublish the whole package. However, because the other versions of supertools are older than 24 hours Brenna has to contact support@npmjs.com to continue to unpublish. After discussing the matter, Brenna opts instead to transfer ownership of the package to Sarah.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Supreet is the maintainer of a package named “fab-framework-plugin”, which has 2 published versions: &lt;code&gt;0.0.1&lt;/code&gt; and &lt;code&gt;1.0.0&lt;/code&gt;. fab-framework-plugin gets around 5,000 downloads monthly across both versions, but most packages depend on it via &lt;code&gt;^1.0.0&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Supreet realizes that there are several serious bugs in &lt;code&gt;1.0.0&lt;/code&gt; and would like to completely unpublish the version. He attempts to unpublish and is prompted to talk to support@npmjs.com because the &lt;code&gt;1.0.0&lt;/code&gt; version of his package is older than 24 hours. Instead, Supreet publishes a new version with bug fixes, &lt;code&gt;1.0.1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Because all dependents are satisfied by &lt;code&gt;1.0.1&lt;/code&gt;, support agrees to grant Supreet’s request to delete &lt;code&gt;1.0.0&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tef works for Super Private Company, which has several private
  packages it use to implement static analysis on Node.js packages.&lt;/p&gt;

&lt;p&gt;Working late one night, Tef accidentally publicly publishes a private package called “@super-private-company/secrets”. Immediately noting his mistake, Tef unpublishes secrets. Because secrets was only up for a few minutes — well within the 24 window for unrestricted unpublishes — Tef is able to successfully unpublish.&lt;/p&gt;

&lt;p&gt;Because Tef is a responsible developer aware of security best-practices, Tef realizes that the contents of &lt;code&gt;secrets&lt;/code&gt; have been effectively disclosed, and spends the rest of the evening resetting passwords and apologizing to his coworkers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Charlotte is the maintainer of a package called “superfoo”. superfoo is a framework on which no packages depend. However, the consultancy Cool Kids Club has been using it to develop their applications for years. These applications are private, and not published to the registry, so they don’t count as packages that depend on superfoo.&lt;/p&gt;

&lt;p&gt;Charlotte burns out on open source and decides to unpublish all of their packages, including superfoo. Even though there are no published dependents on superfoo, superfoo is older than 24 hours, and therefore Charlotte must contact support@npmjs.com to unpublish it.&lt;/p&gt;

&lt;p&gt;After Charlotte contacts support, insisting on the removal of superfoo, npm &lt;a href="https://docs.npmjs.com/cli/deprecate"&gt;deprecates&lt;/a&gt; superfoo with a message that it is no longer supported. Whenever it is installed, a notice is displayed to the installer.&lt;/p&gt;

&lt;p&gt;Cool Kids Club sees this notice and republishes superfoo as “coolfoo”. Cool Kids Club software now depends on “coolfoo” and therefore does not break.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;h2&gt;Changes to come&lt;/h2&gt;

&lt;p&gt;This policy is a first step towards balancing the rights of individual publishers with npm’s responsibility to maintain the social cohesion of the open source community.&lt;/p&gt;

&lt;p&gt;The policy still relies on human beings making human decisions with their human brains. It’s a fairly clear policy, but there is “meat in the machine”, and that means it will eventually reach scaling problems as our community continues to grow.&lt;/p&gt;

&lt;p&gt;In the future, we may extend this policy (including both the human and automated portions) to take into account such metrics as download activity, dependency checking, and other measures of how essential a package is to the community.&lt;/p&gt;

&lt;h2&gt;Moving forward&lt;/h2&gt;

&lt;p&gt;In balancing individual and community needs, we’re extremely cognizant that developers feel a sense of ownership over their code. Being able to remove it is a part of that ownership.&lt;/p&gt;

&lt;p&gt;However, npm exists to facilitate a productive community. That means
we must balance individual ownership with collective benefit.&lt;/p&gt;

&lt;p&gt;That tension is at the very core of open source. No package ecosystem
can survive without the ability to share and distribute code. That’s
why, when you publish a package to the registry, you agree to our
&lt;a href="https://github.com/npm/policies/blob/master/open-source-terms.md"&gt;Terms of Service&lt;/a&gt;. The key lines are:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Your Content belongs to you. You decide whether and how to license it. But at a minimum, you license npm to provide Your Content to users of npm Services when you share Your Content. That special license allows npm to copy, publish, and analyze Your Content, and to share its analyses with others. npm may run computer code in Your Content to analyze it, but npm’s special license alone does not give npm the right to run code for its functionality in npm products or services.&lt;/p&gt;
  
  &lt;p&gt;When Your Content is removed from the Website or the Public Registry, whether by you or npm, npm’s special license ends when the last copy disappears from npm’s backups, caches, and other systems. Other licenses, such as open source licenses, may continue after Your
  Content is removed. Those licenses may give others, or npm itself, the right to share Your Content with npm Services again.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These lines are the result of a clarification that we asked our lawyer to make for the purposes of making this policy as understandable as possible. You can see that in &lt;a href="https://github.com/npm/policies/pull/43/"&gt;this PR&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We don’t try to hide our policies; in fact, we encourage you to review their full list of changes and updates, linked from every &lt;a href="https://www.npmjs.com/policies"&gt;policy page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We acknowledge that there are cases where you are justified in wanting to remove your code, and also that removing packages can cause harm to other users. That’s exactly why we are working so hard on this issue.&lt;/p&gt;

&lt;p&gt;This new policy is just the first of many steps we’ll be taking. We’ll be depending on you to help us consider edge cases, make tough
choices, and continue building a robust ecosystem where we can all
build amazing things.&lt;/p&gt;

&lt;p&gt;You probably have questions about this policy change, and maybe you have a perspective you’d like to share, too.&lt;/p&gt;

&lt;p&gt;We appreciate your feedback, even when we can’t respond to all of it. Your participation in this ecosystem is the core of its greatness. Please keep commenting and contributing: you are an important part of this community!&lt;/p&gt;

&lt;p&gt;Please post comments and questions &lt;a href="https://github.com/npm/policies/issues/44"&gt;here&lt;/a&gt;. We’ve moved to a Github issue for improved moderation.&lt;/p&gt;</description><link>http://blog.npmjs.org/post/141905368000</link><guid>http://blog.npmjs.org/post/141905368000</guid><pubDate>Tue, 29 Mar 2016 09:57:35 -0700</pubDate><dc:creator>agdubs</dc:creator></item><item><title>Package install scripts vulnerability</title><description>&lt;p&gt;Disclaimer: we had been told this vulnerability would be disclosed on Monday, not Friday, so this post is a little rushed and may be edited later.&lt;/p&gt;

&lt;p&gt;As disclosed to us in January and formally discussed in CERT &lt;a href="https://www.kb.cert.org/vuls/id/319816"&gt;vulnerability note VU#319816&lt;/a&gt;, it is possible for a maliciously-written npm package, when installed, to execute a script that includes itself into a new package that it then publishes to the registry, and to other packages owned by that user.&lt;/p&gt;

&lt;p&gt;npm cannot guarantee that packages available on the registry are safe. If you see malicious code on the registry, report it to &lt;a href="mailto:support@npmjs.com"&gt;support@npmjs.com&lt;/a&gt; and it will be taken down.&lt;/p&gt;

&lt;h2&gt;How to protect yourself&lt;/h2&gt;

&lt;p&gt;If you are installing a package that you do not trust, you can avoid this vulnerability by running&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install &lt;pkgname&gt; --ignore-scripts&lt;/pkgname&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you wish to never run scripts at install time, you can instead run&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm config set ignore-scripts true&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Either or both of these steps will prevent you from spreading a worm at install time.&lt;/p&gt;

&lt;p&gt;If you install a package that contains malicious code and then execute it (e.g. by &lt;code&gt;require()&lt;/code&gt;ing it into your code) it could still perform malicious actions. You should not execute any software downloaded from the Internet if you do not trust it, including software downloaded from npm.&lt;/p&gt;

&lt;h2&gt;Why does this vulnerability exist?&lt;/h2&gt;

&lt;p&gt;Installation and other lifecycle scripts are a useful tool that allows package authors to set up configuration, compile binary dependencies, and perform other actions that make using npm packages convenient.&lt;/p&gt;

&lt;p&gt;On balance, it’s npm’s belief that the utility of having installation scripts is greater than the risk of worms. This is a tradeoff that we will continue to evaluate.&lt;/p&gt;

&lt;h2&gt;Is this new?&lt;/h2&gt;

&lt;p&gt;Package scripts have been a feature of npm since the very beginning. The implications of this feature were clear from the start, but not everyone in the ever-expanding npm community is fully aware of them. Disclosures of this kind are helpful for that reason.&lt;/p&gt;

&lt;h2&gt;What happens if a worm is published?&lt;/h2&gt;

&lt;p&gt;You should report malicious packages to &lt;a href="mailto:support@npmjs.com"&gt;support@npmjs.com&lt;/a&gt;. Per our terms of service, they will be taken down. Authors publishing malicious code to the registry may be banned from the registry.&lt;/p&gt;

&lt;p&gt;npm monitors publish frequency. A spreading worm would set off alarms within npm, and if a spreading worm were identified we could halt all publishing while infected packages were identified and taken down.&lt;/p&gt;

&lt;h2&gt;Can npm scan packages for worms?&lt;/h2&gt;

&lt;p&gt;npm is working with security vendors to introduce enhanced security vulnerability scanning and mitigation services. This work is underway but not yet ready.&lt;/p&gt;

&lt;p&gt;At root, it is impossible to guarantee that any new piece of software is benign short of manually inspecting it, as mobile app stores do. The work required to do this would be prohibitively expensive. Instead, we rely on users to flag suspicious packages and act quickly to remove them from the registry.&lt;/p&gt;

&lt;h2&gt;What else can be done?&lt;/h2&gt;

&lt;p&gt;Other potential steps can be taken to make publishing without an author’s knowledge harder, including implementing 2-factor authentication on publishing. This functionality is already available via integrations in npm On-Site, and npm is working to make various 2-factor solutions available to the public registry. This work is also not yet complete.&lt;/p&gt;

&lt;h2&gt;What if I…&lt;/h2&gt;

&lt;p&gt;Ultimately, if a large number of users make a concerted effort to publish malicious packages to npm, malicious packages will be available on npm. npm is largely a community of benevolent, helpful people, and so the overwhelming majority of software in the registry is safe and often useful. We hope the npm community continues to help us to keep things that way, and we will do our best to continuously improve the reliability and security of the registry.  &lt;/p&gt;</description><link>http://blog.npmjs.org/post/141702881055</link><guid>http://blog.npmjs.org/post/141702881055</guid><pubDate>Fri, 25 Mar 2016 22:16:44 -0700</pubDate><dc:creator>seldo</dc:creator></item><item><title>kik, left-pad, and npm</title><description>&lt;p&gt;Earlier this week, many npm users suffered a disruption when a package
that many projects depend on — directly or indirectly — was
unpublished by its author, as part of a dispute over a package name.
The event generated a lot of attention and raised many concerns,
because of the scale of disruption, the circumstances that led to this
dispute, and the actions npm, Inc. took in response.&lt;/p&gt;

&lt;p&gt;Here’s an explanation of what happened.&lt;/p&gt;

&lt;h2&gt;Timeline&lt;/h2&gt;

&lt;p&gt;In recent weeks, &lt;a href="https://twitter.com/azerbike"&gt;Azer Koçulu&lt;/a&gt; and
&lt;a href="http://www.kik.com/"&gt;Kik&lt;/a&gt; exchanged
&lt;a href="https://medium.com/@mproberts/a-discussion-about-the-breaking-of-the-internet-3d4d2a83aa4d"&gt;correspondence&lt;/a&gt;
over the use of the module name &lt;code&gt;kik&lt;/code&gt;.  They weren’t able to come to an
agreement. Last week, a representative of Kik contacted us to ask for
help resolving the disagreement.&lt;/p&gt;

&lt;p&gt;This hasn’t been the first time that members of the community have
disagreed over a name. In a global namespace for unscoped modules,
collisions are inevitable. npm has a &lt;a href="https://www.npmjs.com/policies/disputes"&gt;package name dispute
resolution policy&lt;/a&gt; for this
reason.  That policy encourages parties to attempt an amicable
solution, and when one is impossible, articulates how we resolve the
dispute.&lt;/p&gt;

&lt;p&gt;The policy’s overarching goal is this: &lt;em&gt;provide npm users with the
package they expect&lt;/em&gt;. This covers spam, typo-squatting, misleading
package names, and also more complicated cases such as this one.
Entirely on this basis, we concluded that the package name &amp;ldquo;kik&amp;rdquo;
ought to be maintained by Kik, and informed both parties.&lt;/p&gt;

&lt;p&gt;So far, this followed a process that is routine, though rare.
What happened next, though, was unprecedented.&lt;/p&gt;

&lt;p&gt;Under our dispute policy, an existing package with a disputed name
typically remains on the npm registry; the new owner of the name
publishes their package with a breaking version number. Anyone using
Azer’s existing &lt;code&gt;kik&lt;/code&gt; package would have continued to find it.&lt;/p&gt;

&lt;p&gt;In this case, though, without warning to developers of dependent
projects, Azer unpublished his &lt;code&gt;kik&lt;/code&gt; package and 272 other packages.
One of those was &lt;a href="https://www.npmjs.com/package/left-pad"&gt;left-pad&lt;/a&gt;.
This impacted many thousands of projects. Shortly after 2:30 PM
(Pacific Time) on Tuesday, March 22, we began observing hundreds of
failures per minute, as dependent projects — and their dependents, and
&lt;em&gt;their&lt;/em&gt; dependents… — all failed when requesting the now-unpublished
package.&lt;/p&gt;

&lt;p&gt;Within ten minutes, &lt;a href="https://www.npmjs.com/~westlac"&gt;Cameron Westland&lt;/a&gt;
stepped in and published a functionally identical version of
&lt;code&gt;left-pad&lt;/code&gt;. This was possible because &lt;code&gt;left-pad&lt;/code&gt; is open source, and we
allow anyone to use an abandoned package name as long as they don’t
use the same version numbers.&lt;/p&gt;

&lt;p&gt;Cameron’s &lt;code&gt;left-pad&lt;/code&gt; was published as version &lt;code&gt;1.0.0&lt;/code&gt;, but we
continued to observe many errors. This happened because a number of
dependency chains, including &lt;code&gt;babel&lt;/code&gt; and &lt;code&gt;atom&lt;/code&gt;, were bringing it in
via &lt;code&gt;line-numbers&lt;/code&gt;, which explicitly requested &lt;code&gt;0.0.3&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We conferred with Cameron and took the unprecedented step of
re-publishing the original &lt;code&gt;0.0.3&lt;/code&gt;. This required relying on a backup,
since re-publishing isn’t otherwise possible. We &lt;a href="https://twitter.com/seldo/status/712414400808755200"&gt;announced this plan
at 4:05 PM&lt;/a&gt; and
&lt;a href="https://twitter.com/seldo/status/712427318870839296"&gt;completed the
operation&lt;/a&gt; by
4:55 PM.&lt;/p&gt;

&lt;p&gt;The duration of the disruption was 2.5 hours.&lt;/p&gt;

&lt;h2&gt;What worked&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;We stand by our package name dispute resolution policy, and the
decision to which it led us.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Given two packages vying for the name &lt;code&gt;kik&lt;/code&gt;, we believe that a
substantial number of users who type &lt;code&gt;npm install kik&lt;/code&gt; would be
confused to receive code unrelated to the messaging app with over 200
million users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The dispute resolution policy minimizes disruption.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Transferring ownership of a package’s name doesn’t remove current
versions of the package.  Dependents can still retrieve and install
it.  Nothing breaks.&lt;/p&gt;

&lt;p&gt;Had Azer taken no action, Kik would have published a new version of
&lt;code&gt;kik&lt;/code&gt; and everyone depending upon Azer’s package could have continued
to find it.&lt;/p&gt;

&lt;p&gt;It was abrupt unpublishing, not our resolution policy, that led
to yesterday’s disruptions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The community stepped in.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It’s pretty remarkable that Cameron stepped in to replace &lt;code&gt;left-pad&lt;/code&gt;
within ten minutes. The other 272 affected modules were adopted by
others in the community in a similar time. They either re-published
forks of the original modules or created “dummy” packages to prevent
malicious publishing of modules under their names.&lt;/p&gt;

&lt;p&gt;We’re grateful to everyone who stepped in. With their explicit
permission, we are working with them to transfer these to npm’s direct
control.&lt;/p&gt;

&lt;h2&gt;What didn’t work&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Unrestricted un-publishing caused a lot of pain.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are historical reasons for why it’s possible to un-publish
a package from the npm registry. However, we’ve hit an inflection
point in the size of the community and how critical npm has become to
the Node and front-end development communities.&lt;/p&gt;

&lt;p&gt;Abruptly removing a package disrupted many thousands of developers and
threatened everyone’s trust in the foundation of open source software:
that developers can rely and build upon one another’s work.&lt;/p&gt;

&lt;p&gt;npm needs safeguards to keep anyone from causing so much disruption.
If these had been in place yesterday, this post-mortem wouldn’t be
necessary.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Poor communication made matters worse.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the immediate wake of yesterday’s disruption, and continuing even
now on blogs and Twitter, a lot of impassioned debate was based on
falsehoods.&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;p&gt;npm did not “steal” Azer’s code.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;left-pad&lt;/code&gt; was open-source code, and explicitly allows
republishing by any other author. That&amp;rsquo;s what happened in this
case.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This incident did not arise because of intellectual property law.&lt;/p&gt;

&lt;p&gt;We’re aware that Kik and Azer discussed the legal issues
surrounding the “Kik” trademark, but that wasn’t pertinent.  Our
decision relied on our dispute resolution policy.  It was solely an
editorial choice, made in the best interests of the vast majority
of npm’s users.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;npm won’t suddenly take your package name.&lt;/p&gt;

&lt;p&gt;Our guiding principle is to prevent confusion among npm users. In
the rare event that another member of the community requests our
help resolving a conflict, we work out a resolution by
communicating with both sides.  In the overwhelming majority of
cases, these resolutions are amicable.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;It took us too long to get you this update.  If this were a purely
technical operations outage, our internal processes would have been
much more up to the challenge.&lt;/p&gt;

&lt;h2&gt;What happens next&lt;/h2&gt;

&lt;p&gt;There are technical and social aspects to this problem. Any
reasonable course of action must address both of these.&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;&lt;p&gt;We will make it harder to un-publish a version of a package if
doing so would break other packages.&lt;/p&gt;

&lt;p&gt;We are still fleshing out the technical details of how this will
work. Like any registry change, we will of course take our time to
consider and implement it with care.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We will make it harder to maliciously adopt an abandoned package name.&lt;/p&gt;

&lt;p&gt;If a package with known dependents is completely unpublished,
we’ll replace that package with a &lt;a href="https://github.com/npm/security-holder"&gt;placeholder
package&lt;/a&gt; that prevents
immediate adoption of that name. It will still be possible to get
the name of an abandoned package by contacting npm support.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We are updating our internal policies to help our team stay in sync
and address community conflict more effectively.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;h2&gt;To Recap (tl;dr)&lt;/h2&gt;

&lt;ul&gt;&lt;li&gt;We dropped the ball in not protecting you from a disruption caused
by unrestricted unpublishing.  We&amp;rsquo;re addressing this with technical
and policy changes.&lt;/li&gt;
&lt;li&gt;npm&amp;rsquo;s well-established and &lt;a href="https://www.npmjs.com/policies/disputes"&gt;documented dispute resolution
policy&lt;/a&gt; was followed to the
letter.  This is not a legal dispute.&lt;/li&gt;
&lt;li&gt;We&amp;rsquo;ll continue to do everything we can to reduce friction in
the lives of JavaScript developers.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;In a community of millions of developers, some conflict is inevitable.
We can’t head off every disagreement, but we can earn your trust that
our policies and actions are biased to supporting as many developers
as possible.&lt;/p&gt;</description><link>http://blog.npmjs.org/post/141577284765</link><guid>http://blog.npmjs.org/post/141577284765</guid><pubDate>Wed, 23 Mar 2016 18:21:47 -0700</pubDate><dc:creator>izs</dc:creator></item><item><title>Introducing Greenkeeper for npm On-Site</title><description>&lt;p&gt;Keeping dependencies up to date in your modules is a tedious chore,
but it’s very important; the further you drift away from the
&lt;code&gt;latest&lt;/code&gt; release of a dependency, the more difficult and risky an
upgrade becomes. I’ve found that, despite developers’ best
intentions, dependencies tend to gradually drift behind:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://68.media.tumblr.com/75aec31758de6c8b1c7dac5ee245f008/tumblr_inline_o41pg5NNeR1qcswvu_540.png" alt="image"/&gt;&lt;/p&gt;

&lt;p&gt;Enter &lt;em&gt;Greenkeeper&lt;/em&gt;. Greenkeeper solves the problem of keeping your dependencies up to date:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;p&gt;automatically creating a branch when dependent modules have changed;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;kicking off CI, so that you can see if the changes break your build;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;and&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;providing detailed context about relevant updates in a pull request:&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;img src="http://68.media.tumblr.com/d335a9d00ab7bbdd6c26286859a1faa9/tumblr_inline_o41pltdFa51qcswvu_540.png" alt="image"/&gt;&lt;/p&gt;

&lt;p&gt;Open source developers (like me!) who have integrated Greenkeeper into their continuous integration workflow have found it indispensible. But what if you’re &lt;a href="http://blog.npmjs.org/post/139373244435/practices-perfected-in-oss-can-reshape-enterprise?utm_campaign=20160314greenkeeper?utm_campaign=20160314greenkeeper"&gt;bringing open source’s best practices to the enterprise&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;Good news!&lt;/p&gt;

&lt;h2&gt;Announcing Greenkeeper for npm On-Site&lt;/h2&gt;

&lt;p&gt;We’re excited today to announce that Greenkeeper now integrates with npm On-Site. The integration allows you to configure Greenkeeper’s automated dependency management workflow for the modules that you develop privately within your company.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://68.media.tumblr.com/64dd56f7e00e813ec78a52e4090a2f56/tumblr_inline_o41pqk2PYo1qcswvu_540.png" alt="image"/&gt;&lt;/p&gt;

&lt;h2&gt;npm and Inner Source&lt;/h2&gt;

&lt;p&gt;This integration fits wonderfully into our mission of &lt;a href="http://blog.npmjs.org/post/139373244435/practices-perfected-in-oss-can-reshape-enterprise"&gt;Inner Source&lt;/a&gt;: empowering developers within companies of all sizes to benefit from the awesome tooling and best practices of the open source community.&lt;/p&gt;

&lt;p&gt;Greenkeeper solves a very real problem for developers — keeping dependencies up to date — and it’s already seen wide adoption in the open source world. We’re excited to partner with Greenkeeper to bring this same slick workflow to companies’ private module development.&lt;/p&gt;

&lt;p&gt;If you’d like to give Greenkeeper a shot, they’d love to hear from you: &lt;a href="https://greenkeeper.io/#enterprise"&gt;contact Greenkeeper about starting an enterprise trial&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And, as always, if you’d like to talk about how to bring npm into your large organization — or just see a demo of how easy it is to spin up an npm instance behind your firewall —  give it a whirl: &lt;a href="https://www.npmjs.com/npm/on-site?utm_campaign=20160314greenkeeper"&gt;discover npm On-Site&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.npmjs.org/post/141094613245</link><guid>http://blog.npmjs.org/post/141094613245</guid><pubDate>Tue, 15 Mar 2016 09:30:40 -0700</pubDate><dc:creator>bencoe</dc:creator></item><item><title>Practices Perfected In OSS Can Reshape Enterprise Development</title><description>&lt;p&gt;&lt;a href="https://www.npmjs.com/"&gt;npm, Inc.&lt;/a&gt; helps more than 3 million open source developers build communities, learn, collaborate, and ultimately publish software that’s used by many of the largest companies in the world.&lt;/p&gt;

&lt;p&gt;I believe that this open source development process works. Some great studies back up this belief: In their 2015 article &lt;a href="http://www.infoq.com/news/2015/10/innersource-at-paypal"&gt;InnerSource: Internal Open Source at PayPal&lt;/a&gt;, PayPal describes introducing open source practices into their engineering culture, and the results are exciting:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;The results were visible after 6 months. The Checkout Platform team spends 0% of its time rewriting code and just 10% reviewing submissions. The team was able to do a major refactoring and a 4x increase in performance without planning for it. The mindset moved from blocking change to mentoring and coaching.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this post I focus on &lt;em&gt;tooling&lt;/em&gt;, one important aspect of the open source process:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;how developers interact with a community to discover best practices, and in turn find the best tools;&lt;/li&gt;
&lt;li&gt;how this ad-hoc standardization process puts developers in a good place to &lt;em&gt;automate all the things&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;I’ll conclude by discussing the steps that npm On-Site and other industry leaders are taking to bring these open source tools and practices into the enterprise.&lt;/p&gt;

&lt;h2&gt;Best Practices are Community Driven&lt;/h2&gt;

&lt;p&gt;It’s amazing to watch best practices spread across OSS communities. Just a few years ago, projects rarely had unit-tests; now unit-tests are one of the first things folks look for in a healthy project. Developers learned running large open source projects that writing descriptive unit-tests was a great habit: It helped people familiarize themselves with codebases, and prevented regressions as new features were added.&lt;/p&gt;

&lt;p&gt;How do good habits like unit-testing spread? There’s a wonderful feedback loop created by the social sites where people share and discover code:&lt;/p&gt;

&lt;p&gt;npm’s website maintains a list of most-depended-upon modules, getting a module on this list is a great motivator for module builders. But how do developers get on this list? What works best is studying the projects of other maintainers already on this list, interacting with the developers, learning from them, and emulating their methodologies. This process means habits and best practices spread quickly across the whole community.&lt;/p&gt;

&lt;p&gt;Badges are a great example of this process:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://travis-ci.org/bcoe/yargs"&gt;&lt;img src="https://img.shields.io/travis/bcoe/yargs.svg" alt="Build Status"/&gt;&lt;/a&gt;
&lt;a href="https://gemnasium.com/bcoe/yargs"&gt;&lt;img src="https://img.shields.io/gemnasium/bcoe/yargs.svg" alt="Dependency Status"/&gt;&lt;/a&gt;
&lt;a href="https://coveralls.io/github/bcoe/yargs"&gt;&lt;img src="https://img.shields.io/coveralls/bcoe/yargs.svg" alt="Coverage Status"/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Among the first things developers look for in a healthy OSS project is a set of green badges along the top of its README documentation. These badges emerged organically from the developer community to indicate qualities including passing unit-tests, healthy code coverage percentages, and up-to-date project dependencies. The emergence of badges has, in turn, lead to better software development practices in the community. So cool!&lt;/p&gt;

&lt;h2&gt;Best Practices Center Around Great Tools&lt;/h2&gt;

&lt;p&gt;As effective development habits spread across the community, developers start to converge on the tools that best facilitate these practices. Let’s look at the top 10 modules listed on the npm registry:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;10/10 are published to npm.&lt;/li&gt;
&lt;li&gt;10/10 host their code on GitHub.&lt;/li&gt;
&lt;li&gt;9/10 run their unit tests on Travis CI.&lt;/li&gt;
&lt;li&gt;3/10 use coveralls.io for tracking test coverage.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;As the developer community arrives at a standard set of tools, incentives grow for these tools to work together elegantly.&lt;/p&gt;

&lt;p&gt;Consider one average workflow of an npm module developer:&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;a user pushes code to GitHub and creates a pull request;&lt;/li&gt;
&lt;li&gt;a build kicks off on Travis CI, installing modules from npm, and running tests;&lt;/li&gt;
&lt;li&gt;the GitHub pull request is automatically updated with status messages from Travis CI and Coveralls;&lt;/li&gt;
&lt;li&gt;upon build completion, coveralls.io maintains a history of coverage information, and will fail a build if this coverage decreases;&lt;/li&gt;
&lt;li&gt;once the pull request is merged, the package is published to npm.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;Various checks and balances automatically ensure code quality along the way — and at the end of the day, all of our badges remain green.&lt;/p&gt;

&lt;p&gt;With the right set of tools, tasks that were once frustrating and manual — e.g., making sure that a pull request doesn’t break your project — become fun.&lt;/p&gt;

&lt;h2&gt;InnerSource: Don&amp;rsquo;t Leave Your Best Tools at Home&lt;/h2&gt;

&lt;p&gt;npm is dedicated to the concept of &lt;a href="http://paypal.github.io/InnerSourceCommons/"&gt;InnerSource&lt;/a&gt;. Originally coined by Tim O'Reilly in 2000, the term refers to applying the best open source practices and tools to building enterprise software.&lt;/p&gt;

&lt;p&gt;To help make InnerSource a reality, &lt;a href="https://www.npmjs.com/npm/on-site"&gt;npm On-Site&lt;/a&gt; has teamed up with &lt;a href="https://enterprise.travis-ci.com/"&gt;Travis CI Enterprise&lt;/a&gt;, &lt;a href="https://enterprise.coveralls.io/"&gt;Coveralls Enterprise&lt;/a&gt;, and &lt;a href="https://enterprise.github.com"&gt;GitHub Enterprise&lt;/a&gt; to bring OSS developers’ elegant workflow to the enterprise.&lt;/p&gt;

&lt;p&gt;What does this look like exactly?&lt;/p&gt;

&lt;p&gt;Travis CI, Coveralls.io, and npm On-Site are working to build a similar installation experience. If you can get one product up and running, you can run the full suite. We’re also working together to keep our roadmaps in alignment; features will be built that compliment the full suite of products.&lt;/p&gt;

&lt;p&gt;I’m excited about this direction for npm On-Site, and it’s wonderful to collaborate with other Open Source leaders. With hard work and evangelism, InnerSource can help make writing code at work as much fun as writing open source software on weekends. At the same time, open source practices can help make the enterprise software development cycle faster, while producing higher quality software.&lt;/p&gt;

&lt;p&gt;Do you think that Open Source practices apply well in the Enterprise? Are there other useful tools that make your development workflow better? I would love to hear from you.&lt;/p&gt;</description><link>http://blog.npmjs.org/post/139373244435</link><guid>http://blog.npmjs.org/post/139373244435</guid><pubDate>Mon, 15 Feb 2016 11:48:59 -0800</pubDate><category>InnerSource</category><category>OpenSource</category><dc:creator>bencoe</dc:creator></item></channel></rss>
