Skip to content

Instantly share code, notes, and snippets.

View track0x1's full-sized avatar

Tom B track0x1

View GitHub Profile
@track0x1
track0x1 / README.md
Last active May 15, 2017 18:34
Conquering npm shrinkwrap (in layman's terms)

Conquering npm shrinkwrap (in layman's terms)

We've all been there. You start with a simple app idea and get to work. With the vast number of packages available on npmjs.org, your dependency list begins to grow exponentially. You then hear about a neat npm CLI command called shrinkwrap.

What is it?

[Shrinkwrap] locks down the versions of a package's dependencies so that you can control exactly which versions of each dependency will be used when your package is installed. – npmjs

Life without shrinkwrap

@track0x1
track0x1 / index.js
Last active April 5, 2019 14:17
lambot-snippets
const yaml = require('js-yaml');
const tasks = require('./tasks'); // An object of supported tasks (functions)
// Helper function that attempts to run a task
function runTask(name, taskData) {
// Ensure valid task provided
if (!tasks[name]) return Promise.reject(`Invalid task name of '${name}' provided.`);
return tasks[name].call(null, taskData);
}