Skip to content

Instantly share code, notes, and snippets.

@cspotcode
Last active August 29, 2015 14:27
Show Gist options
  • Save cspotcode/9aa1173f2f8e8b714653 to your computer and use it in GitHub Desktop.
Save cspotcode/9aa1173f2f8e8b714653 to your computer and use it in GitHub Desktop.
Storing DefinitelyTyped definitions in npm

###Pros:

  • npm as CDN; no more GitHub API and rate limiting
  • npm provides search & indexing
  • package.json provides metadata
  • handles multiple version numbers
  • npm is download client; simpler tsd CLI

###Cons:

###Questions:

  • If a .d.ts for jQuery is updated -- for example, to add a missing method -- but jQuery has not been updated, what is the new NPM version number? "jQuery.d.ts@2.3.4+1"?
    • .d.ts version numbers should mirror the version numbers of the projects they're defining.
    • Adding +1, +2 to the version number looks clean and shouldn't interfere with existing projects' version numbers
  • How to install multiple definition versions for the same library?
    •     "dependencies": {
             "jquery": "2.3.4",
             "jquery-old": "jquery@1.8.2"
          }
      
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment