{"action":"closed","issue":{"url":"https://api.github.com/repos/lerna/lerna/issues/1373","repository_url":"https://api.github.com/repos/lerna/lerna","labels_url":"https://api.github.com/repos/lerna/lerna/issues/1373/labels{/name}","comments_url":"https://api.github.com/repos/lerna/lerna/issues/1373/comments","events_url":"https://api.github.com/repos/lerna/lerna/issues/1373/events","html_url":"https://github.com/lerna/lerna/issues/1373","id":313939258,"node_id":"MDU6SXNzdWUzMTM5MzkyNTg=","number":1373,"title":"require('lerna'): requiring and running lerna  in a script, not cli ?","user":{"login":"coderjonny","id":753091,"node_id":"MDQ6VXNlcjc1MzA5MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/753091?v=4","gravatar_id":"","url":"https://api.github.com/users/coderjonny","html_url":"https://github.com/coderjonny","followers_url":"https://api.github.com/users/coderjonny/followers","following_url":"https://api.github.com/users/coderjonny/following{/other_user}","gists_url":"https://api.github.com/users/coderjonny/gists{/gist_id}","starred_url":"https://api.github.com/users/coderjonny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coderjonny/subscriptions","organizations_url":"https://api.github.com/users/coderjonny/orgs","repos_url":"https://api.github.com/users/coderjonny/repos","events_url":"https://api.github.com/users/coderjonny/events{/privacy}","received_events_url":"https://api.github.com/users/coderjonny/received_events","type":"User","site_admin":false},"labels":[{"id":295312276,"node_id":"MDU6TGFiZWwyOTUzMTIyNzY=","url":"https://api.github.com/repos/lerna/lerna/labels/stale","name":"stale","color":"ffffff","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-04-13T01:26:38Z","updated_at":"2019-01-03T16:16:35Z","closed_at":"2019-01-03T16:16:35Z","author_association":"NONE","body":"Hi, \r\n\r\nI'd like to use lerna directly in a node script that I'm writing. \r\n\r\nInstead of using bash to call the lerna cli, can I use lerna directly in a file? \r\n\r\nInstead of this\r\n```\r\nconst cp = require(\"child_process\");\r\n\r\n...\r\n\r\n                cp.execFileSync(\r\n                    \"yarn\",\r\n                    [\r\n                        \"lerna\",\r\n                        \"add\",\r\n                        `${module}@${myVersion}`,\r\n                        \"--scope\",\r\n                        \"packages/*\"\r\n                    ],\r\n                    {\r\n                        stdio: \"inherit\"\r\n                    }\r\n                );\r\n\r\n```\r\n\r\nCan I expose lerna in a file something like this, to run a lerna command ?\r\n\r\n```\r\nconst lerna = require('lerna');\r\n```\r\n\r\n\r\nthank you,\r\n\r\n"}}
{"actor":{"display_login":"stale"}}