Yarn: Public JS API

Created on 12 Oct 2016  路  19Comments  路  Source: yarnpkg/yarn

I read on this Facebook article that Yarn exposes a public javascript API but the api.js file is currently empty. Is this feature in the works or is there documentation on how to get started using the api?

Most helpful comment

Can someone please re-open this? I also really need a way to access yarn programmatically

All 19 comments

Yes, I too was about to create an issue regarding being able to programmatically use Yarn as part of my build tools.

https://github.com/yarnpkg/rfcs

Mind opening here?

Thanks 馃榿

Was the post referring to the --json argument?

> yarn
yarn install v0.15.1
success Already up-to-date.
Done in 0.15s.
> yarn --json
{"type":"success","data":"Already up-to-date."}
{"type":"finished","data":142}

@FLGMwt no, having the ability to do something like import { install } from 'yarn/lib/api' and use something in the matter of await install(/* options etc */)

Ahhh, gotcha. Thought you meant more structured output for parsing as part of a build script. That makes more sense : )

Created RFC issue here: https://github.com/yarnpkg/rfcs/issues/6

Go right ahead and give it some love with some 馃憤 's :)

Anyone know what happened to this RFC? The link to https://github.com/yarnpkg/rfcs/issues/6 404's

@southpolesteve from their GitHub repo page (https://github.com/yarnpkg/rfcs/pulls) you can see that they disabled the issues feature.

Therefore all issues non 404.

Since the other repo has no issues, i think this should be opened again, unless there is an API.

@samccone can we re open this issue please?

Ping pong

Is there still no sign of a JS API?

We recently split the lockfile parser in a new package, but we have not converged on any unified API yet for the rest of the application.

Oh, bummer.

I'll need to see if this package is a viable alternative for now.

Can someone please re-open this? I also really need a way to access yarn programmatically

Is some news right here?

Not unless someone wants to add the feature themselves and submit a PR.

screen shot 2018-06-27 at 11 54 53 am

bump

Yarn 2 core will come as Node API

Edit missed the Link https://github.com/yarnpkg/berry/blob/master/README.md#generic-packages

Was this page helpful?
0 / 5 - 0 ratings

Related issues

catkins picture catkins  路  3Comments

ocolot picture ocolot  路  3Comments

mnpenner picture mnpenner  路  3Comments

sebmck picture sebmck  路  3Comments

MunifTanjim picture MunifTanjim  路  3Comments