nodejs npm package tutorials

Looking for some tutorials where we have all the information about writing first npm package from scratch, looking forward things like

  1. Mandate folder structure if any
  2. Initiating package
  3. Add dependencies
  4. bin folder (why do we need it?)
  5. Any AMD dependency

Moreover how do we convert a common JS api to npm enabled?

Any pointer or help should be appreciated.

I was able to get things out myself, hence successfully registered the npm package @ https://npmjs.org/package/javascript-boilerplate

Kindly find the answer in the same order as I have asked.

  1. There is no mandate for particular folder structure
  2. npm adduse and npm publish does the job to register the package
  3. Here I was getting the issue, which was essentially driven from jquery 1.8.3 npm package, just removed it and ship the jQuery with my bundle only
  4. I didn't need the bin folder
  5. I don't think so there is any, it may be needed for global npm install