Skip to content

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

Open
@danielamar101

Description

@danielamar101

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Documentationdocumentation related issuews:arboristRelated to the arborist workspace

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions