npm / npm/rfcs

[RRFC] npm init add a new question: type => "commonjs/module"

Open
#620 21 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
777
Forks
267
PR merge metrics
No merged PRs in 30d

Description

Motivation ("The Why")

As more devs are going to use esm, while the default is commonjs. users have to manually add the field after creating.

Example
How
Current Behaviour
package name: (xxx) 
version: (1.0.0) 
description: 
entry point: (index.js) 
test command: 
git repository: 
keywords: 
license: (ISC) 
Desired Behaviour
package name: (xxx) 
version: (1.0.0) 
description: 
type: commonjs/module  ----- new added item.
entry point: (index.js) 
test command: 
git repository: 
keywords: 
license: (ISC) 
References
  • n/a

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the current and desired npm init prompt examples in this issue, then read the discussion for the unresolved behavior around the new type question. Done means the agreed design adds a commonjs/module choice to npm init and produces the corresponding package configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.