Packaging jQuery Plugins
Jump to navigation
Jump to search
Overview[edit]
Process for creating, maintaining, and distributing jQuery plugins using GitHub and npm.
Helper tools[edit]
- jQuery Boilerplate Boilerplate for creating jQuery plugins
Distribution[edit]
Marking a release[edit]
Specifying files to install with npm[edit]
Use the .npmignore file in the root of plugin project to specify which files to exclude when running npm install. .npmignore works the same way as .gitignore. [1]
Publishing npm packages[edit]
I'm actually more interested in distributing packages through GitHub since they are mostly for use in my own projects.
Using plugins in projects[edit]
Use npm to fetch the plugin from GitHub, included in in the project, and add it to the project requirements:
$ npm install git+https://git@github.com/northrose/lightboxLink.git --save
- The
--saveparameter updatespackage.json, adding the package as a dependency of the project. - To use a branch other than
masterappend#branchnameto the repo URL.
- Using jQuery plugins with npm,
npmBlog
See also[edit]
Internal pages[edit]
References[edit]
- ↑
filessetting inpackage.jsondocumentation,npmdocumentation