Registry / devops / js-project-commons

js-project-commons

JSON →
library1.3.2jsnpmunverified

Version 1.3.2 (last release 2021-02-08) is a collection of shared Grunt tasks, lint configurations, and markdown templates for personal Node.js and web projects. It centralizes common build processes (e.g., linting, testing, security validations, GitHub release) and uses ES6 syntax since v1.3.0. Unlike standalone tools, this package bundles dependencies internally (since v1.0.34) and provides ready-to-use Grunt tasks for tasks like stylelint, htmlhint, API doc generation, and file name linting. Release cadence has stopped after 2021, and it is now in maintenance mode. The library is opinionated and primarily intended for the author's projects.

npm install js-project-commons
INSTALL
IMPORT
SIG · JS-PROJECT-COMMONS
J
js-project-commons
devopsjavascriptv1.3.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default import
require('js-project-commons')
import jsProjectCommons from 'js-project-commons'
The package is CJS-only and does not export a default; use require().
Grunt task loading
grunt.loadNpmTasks('js-project-commons')
grunt.loadNpmTasks('js-project-commons/tasks')
Tasks are auto-discovered via loadNpmTasks; no need to specify subpath.
Config in Gruntfile
grunt.initConfig({ eslint: {}, /* overrides */ })
const config = require('js-project-commons/config')
Configs are not exported as separate files; they are applied via Grunt tasks.

Shows how to load the package in a Gruntfile and override eslint config.

// Install: npm install --save-dev js-project-commons // Gruntfile.js module.exports = function(grunt) { grunt.loadNpmTasks('js-project-commons'); grunt.initConfig({ // Override specific task configs here eslint: { options: { configFile: '.eslintrc.js' } } }); grunt.registerTask('build', ['eslint', 'mochaTest']); };
Debug
Known issues
breakingES6 syntax introduced in v1.3.0 may break projects using Node <6.
fix
Upgrade Node.js to version 6 or higher.
affects: >=1.3.0
gotchaInternal dependencies are bundled (since v1.0.34); do not install them separately.
fix
Only install js-project-commons; its dependencies are loaded internally.
affects: >=1.0.34
deprecatedjslint is disabled by default since v1.0.96
fix
Use eslint instead of jslint.
affects: >=1.0.96
gotchaBower.json is no longer required for web projects since v1.3.1
fix
Remove unnecessary bower.json file.
affects: >=1.3.1
breakingKarma browser configuration moved to karma conf instead of grunt task since v1.1.6
fix
Set browser in karma.conf.js, not in Gruntfile.
affects: >=1.1.6
Errors
Common errors & fixes
Error: Cannot find module 'js-project-commons'
Package not installed or missing from node_modules.
fix
Run 'npm install --save-dev js-project-commons'
Warning: Task "eslint" not found. Use --force to continue.
Grunt task not loaded because js-project-commons is not loaded via loadNpmTasks.
fix
Add grunt.loadNpmTasks('js-project-commons') in Gruntfile.
TypeError: js_project_commons is not a function
Trying to call require('js-project-commons') as a function (it's not callable).
fix
Use require('js-project-commons') only to load tasks, not as a function.
Upgrade
Version history
1.3.2latest on npm
Audit
Dependencies
gruntrequiredCore dependency for running Grunt tasks provided by the package.
Agent activity
6 hits · last 30 days
node
6
Resources
js-project-commons — npm install js-project-commons · libregistry