Skip to content

Instantly share code, notes, and snippets.

@joewalnes
Created November 22, 2011 17:51
Show Gist options
  • Select an option

  • Save joewalnes/1386357 to your computer and use it in GitHub Desktop.

Select an option

Save joewalnes/1386357 to your computer and use it in GitHub Desktop.
NPM without NPM
# To find NPM dependencies, use http://search.npmjs.org/
NPM_DEPS += http://registry.npmjs.org/connect/-/connect-1.5.2.tgz
NPM_DEPS += http://registry.npmjs.org/mime/-/mime-1.2.2.tgz
NPM_DEPS += http://registry.npmjs.org/qs/-/qs-0.2.0.tgz
NPM_DEPS += http://registry.npmjs.org/websocket-server/-/websocket-server-1.4.04.tgz
node_modules: Makefile
@rm -rf $@
@mkdir -p $@
@set -e; for DEP in $(NPM_DEPS); do \
ID=`echo $$DEP | sed -e 's|^.*/||;s|-[^-]*$$||'`; \
echo "Fetching NPM dependency $$ID <$$DEP>"; \
mkdir -p $@/$$ID; \
curl -L --silent $$DEP | tar xzf - --strip=1 --directory=$@/$$ID package; \
done
@touch $@
clean:
@rm -rf node_modules
.PHONY: clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment