The difference between Node.js require, and Wordpress plugins or Drupal modules
By: +David Herron; Date: 2015-07-19 18:25
Someone experienced with using Wordpress, or Drupal, to build websites are accustomed to "plugins" or "modules". Both are software modules which extend the functionality of Wordpress or Drupal websites, giving more features to the system than what's available out of the box. For example it's typical for a Drupal site to install Views to support building fancy data displays, and on my Wordpress blog I've added the PODS Framework to simplify defining custom post types along with custom fields.
In Node.js the require statement brings in additional software, and adds more capability, so yes it's similar to a plugin or module for CMS's like Wordpress or Drupal. However, there are plenty of differences especially because Node.js is not a CMS, so therefore Node.js packages are at a different level of granularity.
You can write any kind of program using Node.js, including (but not limited to) content management systems.
This means a Node.js package author has different needs/concerns than a Wordpress plugin, or Drupal module, author. The latter two are concerned with tweaking the CMS's features and therefore hook into API's exposed by the CMS to add functionality. With Node.js, since it is a general purpose programming platform, package authors have a much broader set of goals.
For example, the Grunt or Gulp tools (each are written in Node.js) are build tools widely used to build not just Node.js projects, but all kinds of web projects. Grunt and Gulp are themselves Node.js packages, and then the capability of both products are extendable by other Node.js packages.
Similarly the static website generator I wrote - AkashaCMS - is implemented as a Node.js package, and its features can be extended by plugins that are themselves Node.js packages. Since it is also a content management system, the realm of likely AkashaCMS plugins is similar to the realm of likely Wordpress plugins or Drupal modules.
What I'm getting at is there is no typical Node.js package and the purpose of Node.js packages is not restricted by being in the context of a content management system. In other words, Node.js packages could serve pretty much any purpose, as is evidenced by browsing the NPM package repository.