- Download this gist
- drop the
package.json
where you develop .. say~/www
- online with npm installed? open a terminal and boom ...
npm run launchpack
- follow the prompts to automated heaven
LaunchPack is an tiny yet epic tool for kicking off projects quicker than you do, using packages you already defined, so you're never more then moments away from an initial commit.
You'll go from zero to your own personal hero.
LaunchPack uses npm-scripts to download and organise files from wherever, however.
No more installs. Everything. In. One. Tiny. Package.json
.
- a frontend-fanatic who hones their own HTML, while juggling a JS framework from one boomer with boilerplate SASS from another π₯π¨
- a fullstack god rolling a flavour for each layer (latest WP with your seven favourite plugins and a custom theme thrown in for good measure ... boom it's done) π£β‘οΈ
- AN NPM NINJA ... or ninny, whatever.
Start by pulling together some resources .. lets mix up the king of front-end kickoffs with a bit of foundation:
{
"resources": {
"foundation": "https://github.com/zurb/foundation-sites/archive/master.zip",
"html5boilerplate": "https://github.com/h5bp/html5-boilerplate/archive/master.zip"
}
}
Everything is defined in package.json
, where all the regular caveats apply. We've used GH zip files above to save some overhead, but you can safely use .git
, plus any server you choose.
Next we pick which of our resources to chew on and where:
{
"packages": {
"frontend": [
{
"resource": "html5boilerplate",
"files": "*/dist/"
},
{
"resource": "foundation",
"files": "*/dist/js/",
"output": "/js/vendor/foundation"
},
{
"resource": "foundation",
"files": "*/dist/css/",
"output": "/css/foundation"
}
]
}
}
And there you go, our resources are set to load in order; so it's a html5bp base sprinkled with some foundation scripts and styles. The files and output help us define what goes where (more on that below).
To test our package just open a terminal and kick things off as you would any package.json
:
npm install
Packages aren't very complex. We're talking a list of named resources, loaded in order of appearance, each with 4 possible properties:
This one is self explanatory (and required) - it points to the resource url
Specifies which files/directories you're interested in from the resource - wildcard (*) and not (!) selectors give it super powers! Leave the property out and you get the lot.
Where you want the files to go. Want to place a resource deep down in your structure? Include an output and your files won't ever get a root (note that it's relative to the install directory you are prompted for when you run launchpack)
A bleeding-edge kinda dev? You can change the branch you're checking out with this lovely little tingler. .git
only!
I would literally make babies with someone who can speak bash. Hit a brother up!