@jjuidev/node-devtools
v1.6.1
Published
Node devtools
Maintainers
Readme
@jjuidev/node-devtools
Interactive devtools setup for Node.js projects with ESLint, Prettier, Commitlint, Husky, and Lint-staged.
Features
- Interactive CLI setup with framework detection
- Auto-install dependencies based on your project needs
- Support for React, Next.js, React Native, Tailwind CSS, and Storybook
- Git hooks with Husky and Lint-staged
- Commitlint with devmoji support
- Zero-config defaults for quick setup
Quick Start
npm install --save-dev @jjuidev/node-devtools
# or
yarn add --dev @jjuidev/node-devtools
# or
pnpm add -D @jjuidev/node-devtoolsThen run the interactive setup:
npx node-devtools
# or
yarn node-devtools
# or
pnpm node-devtoolsThe CLI will ask you questions about your project and automatically install the necessary dependencies.
Commands
Interactive Setup (Recommended)
npx node-devtoolsThis command will:
- Ask about your project setup (React, Next.js, Tailwind, etc.)
- Automatically install all required dependencies
- Detect your package manager (npm, yarn, pnpm, bun)
- Install ESLint, Prettier, Husky, Lint-staged, and related plugins
Non-Interactive Setup
For CI/CD pipelines and automation, you can use non-interactive mode with CLI flags or stdin input:
Using CLI Flags
# With specific options
npx node-devtools --framework react --tailwind yes --storybook no --alias yes --gitignore yes
# Accept all defaults
npx node-devtools -y
# Mixed mode (some flags + prompts for rest)
npx node-devtools --framework next --tailwind yesAvailable flags:
--framework <type>- Framework: node, react, react-native, next--tailwind <bool>- Use Tailwind CSS (yes/no)--storybook <bool>- Use Storybook (yes/no)--alias <bool>- Use TypeScript alias imports (yes/no)--gitignore <bool>- Add .gitignore file (yes/no)-y, --yes- Accept all defaults--non-interactive- Force non-interactive mode
Using Stdin (Piped Input)
# Provide answers via stdin (one per line)
echo -e "react\nyes\nno\nyes\nyes" | npx node-devtools
# From a file
cat answers.txt | npx node-devtoolsInput order for stdin:
- Framework (node/react/react-native/next or 1-4)
- Use Tailwind? (yes/no) - only for react/next
- Use Storybook? (yes/no) - only for react/next
- Use TypeScript alias? (yes/no)
- Add .gitignore? (yes/no)
Note: Tailwind and Storybook prompts are skipped for node and react-native frameworks.
Manual Setup
The interactive command configures everything (Commitlint, ESLint, Prettier, Husky, Lint-staged). There are no separate setup or init subcommands in the current version. Use the interactive flow:
npx node-devtoolsWhat Gets Installed?
Base Packages (Always)
husky- Git hookslint-staged- Run linters on staged fileseslint- JavaScript linterprettier- Code formatter@typescript-eslint/eslint-plugin- TypeScript ESLint rules@typescript-eslint/parser- TypeScript parser for ESLinteslint-config-prettier- Disable ESLint rules that conflict with Prettiereslint-plugin-prettier- Run Prettier as an ESLint ruleprettier-plugin-packagejson- Sort package.json
Conditional Packages (Based on Your Answers)
- React:
eslint-plugin-react,eslint-plugin-react-hooks - Next.js:
@next/eslint-plugin-next - React Native:
eslint-plugin-react-native - Tailwind CSS:
eslint-plugin-tailwindcss,prettier-plugin-tailwindcss - Storybook:
eslint-plugin-storybook
Usage
Option 1: Use the recommended configuration
Create .commitlintrc.cjs:
const { commitlintConfigRecommend } = require('@jjuidev/node-devtools');
module.exports = commitlintConfigRecommend;Option 2: Customize the configuration
Create .commitlintrc.cjs:
const { defineCommitlintConfig } = require('@jjuidev/node-devtools');
module.exports = defineCommitlintConfig((emojiList) => {
// Add or modify emoji types
return emojiList.filter((item) => item.type !== 'wip');
});Example: Add custom emoji types
const { defineCommitlintConfig } = require('@jjuidev/node-devtools');
module.exports = defineCommitlintConfig((emojiList) => {
return [
...emojiList,
{
type: 'docker',
code: ':docker:',
emoji: ':whale:',
description: 'Docker related changes'
}
];
});Complete Setup Flow
Install the package
npm install --save-dev @jjuidev/node-devtoolsRun interactive setup
npx node-devtoolsAnswer the questions about your project setup.
Start committing!
git commit -m "feat: add new feature"Hooks are set up automatically; your commit will be validated and emoji will be added!
Supported Commit Types
The recommended configuration includes the following commit types:
init:tada: - Initialize projectfeat:sparkles: - Add new featurefix:bug: - Fix a bugchore:wrench: - Minor tasks or maintenancedocs:memo: - Update documentationstyle:lipstick: - Improve UI or code styleimprove:rocket: - Improve code quality or performancerefactor:recycle: - Refactor code without changing logicperf:zap: - Enhance performancetest:white_check_mark: - Add or update testsbuild:building_construction: - Changes related to the build systemci:repeat: - Configure CI/CDrevert:rewind: - Revert a previous commitmerge:twisted_rightwards_arrows: - Merge brancheswip:construction: - Work in progressrelease:rocket: - Release a new versionupgrade:arrow_up: - Upgrade dependencies or softwaredowngrade:arrow_down: - Downgrade dependencies or softwarebump:package: - Bump package versionsecurity:lock: - Improve securityhotfix:fire: - Urgent bug fixmaintainer:crown: - Maintainer commit and excellent handle for system
Package Manager Detection
The CLI automatically detects your package manager based on lock files:
bun.lockb→ Bunpnpm-lock.yaml→ pnpmyarn.lock→ Yarn- Default → npm
TypeScript Support
The package includes TypeScript type definitions:
import type { CommitlintConfig, CommitEmoji } from '@jjuidev/node-devtools';Contributing
We use Changesets for version management and publishing.
Quick Start for Contributors
# Make your changes
npm run build
# Create a changeset
npm run changeset
# Commit your changes
git commit -m "feat: your feature"See CONTRIBUTING.md for detailed workflow.
Changelog
See CHANGELOG.md for release history.
License
MIT
Author
jjuidev [email protected]
