npm / npm/cli

[DOCS] Clearer instructions on functional parity between arborist and NPM

Open
#4,818 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Documentation ws:arborist
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

Hey there, as a preface, I appreciate everything you guys do to maintain npm and all of its workspaces.

I am trying to programmatically install modules into a project without using exec calls or the deprecated npm programmatic interface. Arborist is the perfect package for this endeavor. However, I am finding it difficult to understand how exactly I can use arborist to mimic an npm install exactly? Do I have to do more than this?

const arb = new Arborist(optionsObject)
await arb.loadActual()
await arb.loadVirtual()
await arb.buildIdealTree({})
await arb.reify();

That example omits error handling.

I guess I am more so confused on how the virtual and actual trees change with changes to a package.json file, and how Arborist handles that.

Thanks in advance.

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 with the Arborist call sequence shown in the issue and review how it is intended to correspond to npm install. Document how actual and virtual trees respond to package.json changes, whether additional steps are needed for functional parity, and how errors should be handled; the work is done when these questions are answered clearly for programmatic users.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.