Packaging jQuery Plugins: Difference between revisions

From Littledamien Wiki
Jump to navigation Jump to search
(Created page with "Category:JQuery Category:JavaScript Category:Web Development == Overview == Process for creating, maintaining, and distributing jQuery plugins using GitHub and `n...")
 
 
(4 intermediate revisions by the same user not shown)
Line 13: Line 13:


See [[Marking Releases With Git]]
See [[Marking Releases With Git]]
=== Specifying files to install with `npm` ===
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`. <ref>[https://docs.npmjs.com/files/package.json#files `files` setting in `package.json` documentation], `npm` documentation</ref>
=== Publishing npm packages ===
I'm actually more interested in distributing packages through GitHub since they are mostly for use in my own projects.
* [http://blog.npmjs.org/post/111475741445/publishing-your-jquery-plugin-to-npm-the-quick Publishing your jQuery plugin to npm, the quick and dirty way], `npm` Blog


=== Using plugins in projects ===
=== Using plugins in projects ===
Use `npm` to fetch the plugin from GitHub, included in in the project, and add it to the project requirements:
<syntaxhighlight lang="bash">
$ npm install git+https://git@github.com/northrose/lightboxLink.git --save
</syntaxhighlight>
* The `--save` parameter updates `package.json`, adding the package as a dependency of the project.
* To use a branch other than `master` append `#branchname` to the repo URL.


* [http://blog.npmjs.org/post/112064849860/using-jquery-plugins-with-npm Using jQuery plugins with npm], `npm` Blog
* [http://blog.npmjs.org/post/112064849860/using-jquery-plugins-with-npm Using jQuery plugins with npm], `npm` Blog
* [http://blog.npmjs.org/post/111475741445/publishing-your-jquery-plugin-to-npm-the-quick Publishing your jQuery plugin to npm, the quick and dirty way], `npm` Blog


== See also ==
== See also ==
Line 28: Line 47:


=== References ===
=== References ===
<referemces />
<references />

Latest revision as of 17:45, 8 April 2016

Overview[edit]

Process for creating, maintaining, and distributing jQuery plugins using GitHub and npm.

Helper tools[edit]

Distribution[edit]

Marking a release[edit]

See Marking Releases With Git

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 --save parameter updates package.json, adding the package as a dependency of the project.
  • To use a branch other than master append #branchname to the repo URL.


See also[edit]

Internal pages[edit]

References[edit]