You have found a plugin or two that you like, so now what? Installing a plugin via npm is also easy but first you need to make sure that you have a package.json
file located in the root of your application. This is a JSON file that is required by npm. If you don't have a package.json
file, npm will not install your plugin. The following is an example of a rather minimalistic package.json
file:
{ "name": "plugins", "version": "1.0.0", "description": "A demo of using and writing plugins", "repository": "none", "license": "MIT", "dependencies": { "tipso": "^1.0.6" } }
Please note that it is a JSON file and not a JavaScript object. The first field is the name of the application. Name is a required field; without it, npm will not install a package. If you are creating a plugin and plan to upload it to npm, the name must be unique.
The second field is the version number of the application. It is also required. The value placed here is very important when you...