Skip to content

Instantly share code, notes, and snippets.

@heapwolf
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heapwolf/ae918a9e0b82fef1c16e to your computer and use it in GitHub Desktop.
Save heapwolf/ae918a9e0b82fef1c16e to your computer and use it in GitHub Desktop.
normalize.github.io

thoughts on normalize for node.

The big questions users will have are

Q. How available will my source files be for development and for runtime?

A. normalize works like a browser. This value proposition should be the loudest on the site. Since people already understand how this works, it's a good mental gateway. The next thing people will ask is: "where are my files?". Since this is a radical departure from the existing workflow of downloading shit-tons of files and having even more copies of them everywhere, an explaination of how files get onto your disk and where they are kept would be great.

Q. What is the proxy and how does the proxy work?

People will be apprehensive about a new serveice. npm's architecture is mysterious and seems unstabe. The more transparent a service is, the more likely people are to trust and use it. So it would be great to break down the proxy function by function and explain how it works at the code level and what the ideal devops configurations are for each platform.

Another really valuable thing is how someone can set up their own normalize proxy in say, 2 easy steps (install could even setup and run platform specific process monitoring). Maybe something like...

  • wget https://path/to/code
  • ./install.sh && ./run

Q. URLs in my require statements make my code ugly

A. Could https:// be assumed as the protocol to get something more like var url = require('nlz.io/npm/-/url/*/index.js')?

A simple short term stop-gap for node

require('node-normalize')
var url = require('nlz.io/npm/-/url/*/index.js')

the node-normalize module would need to recursively pre-process modules. check the cache, if items are not there fetch them, but this needs to be a blocking operation so i used execSync (here is a proof of concept)

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