Tagged articles
package.json
14 articles · Page 1 of 1
Node.js now marks require(esm) as stable in LTS releases, allowing CommonJS files to require synchronous ESM modules without extra flags, simplifying package.json configuration, eliminating the need for dual packages, and resolving the long‑standing CJS‑ESM split for the vast majority of projects.
CommonJSESMLTS
0 likes · 8 min read

This guide explains how to configure Jest test scripts in a package.json file and use npm commands to run the full test suite, generate coverage reports, watch for changes, and target individual test files or cases for faster, more focused development.
JavaScriptJestcli
0 likes · 6 min read


ByteFEApr 9, 2024 · Fundamentals
This article explores the hidden complexities of dependency management in modern Node.js development, covering the risks of unstable package structures, versioning pitfalls, various dependency types, ghost and circular dependencies, and provides practical strategies and best‑practice recommendations to keep dependency graphs stable, secure, and maintainable.
Node.jsnpmpackage.json
0 likes · 28 min read

This guide walks you through building a custom Node.js CLI scaffold using commander, chalk, inquirer, ora, and download‑git‑repo, explains essential package.json fields like bin and engines, and provides a complete demo that prompts users, downloads templates, and initializes projects ready for global installation.
CommanderNode.jscli
0 likes · 17 min read

This article explains how third‑party library authors can configure package.json fields such as main, type, exports, and module to provide dynamic entry points for both CommonJS and ESModule consumers, while also covering TypeScript's resolution strategy and practical code examples.
CommonJSESMExports
0 likes · 12 min read

This article explains why, despite years of ESM usage, Node 18 and TypeScript 4.7 still encounter import errors, explores the differences between CommonJS and ESM module resolution, and shows how to configure tsconfig and package.json to make Node correctly run ESM code.
CommonJSESMNode.js
0 likes · 10 min read

This article walks readers through the complete process of building a well‑structured npm package using TypeScript, covering project initialization, package.json configuration, essential tooling such as husky, lint‑staged, eslint, prettier, unit testing with Jest, and best practices for documentation and publishing.
ESLintJestLibrary
0 likes · 15 min read

This article explains how to design, build, and publish reusable module packages—including shared configuration libraries, UI component libraries, and native language modules—within a monorepo, covering package.json configuration, multiple entry formats (ESM, CJS, UMD), tooling choices, and publishing workflows for both frontend and Node.js projects.
Module DesignNode.jsReact
0 likes · 19 min read

This article provides an in‑depth overview of the package.json file used in frontend projects, covering required fields, description metadata, dependency sections, script commands, file and directory settings, publishing options, and common third‑party configurations with practical code examples.
Configurationdependenciesfrontend
0 likes · 22 min read


ByteFEAug 16, 2021 · Backend Development
This article explains the purpose and structure of yarn.lock, why it may show unexpected diffs after dependency updates, and provides practical strategies—including using resolutions, frozen lockfiles, and preventive workflows—to keep package.json and yarn.lock in sync and avoid build issues.
YARNdependency-managementlockfile
0 likes · 12 min read

The article investigates the April 25 NPM outage caused by the is-promise package, explains the buggy code and the problematic "type" and "exports" fields in package.json, reviews the rapid fix timeline, and offers practical lessons for developers to avoid similar dependency mishaps.
Dependency ManagementExportsis-promise
0 likes · 15 min read

This article explains how Node.js 12 introduced native ECMAScript Modules, compares them with CommonJS, shows how to enable the feature, configure package.json, and adapt code using import/export, import.meta, and other module‑specific changes.
CommonJSES ModulesModules
0 likes · 10 min read

This article explains the role of the scripts section in a Node.js project's package.json, clarifies why commands like npm start work without the run keyword, and shows how to correctly execute custom scripts using npm run, helping developers avoid common pitfalls.
Node.jscommand-linenpm
0 likes · 3 min read

This article explains how npm interprets dependency version specifiers such as caret (^), tilde (~), and range operators, illustrates their effects with lodash examples, covers semantic versioning rules, special cases like 0.x.x versions, and provides test cases to help developers choose the appropriate version constraints.
Dependency Managementcaretlodash
0 likes · 10 min read
