{"id":15634936,"url":"https://github.com/typicode/user-startup","last_synced_at":"2025-04-03T02:11:42.206Z","repository":{"id":35816819,"uuid":"40099399","full_name":"typicode/user-startup","owner":"typicode","description":"Auto start commands when you log in (cross-platform)","archived":false,"fork":false,"pushed_at":"2018-04-10T13:19:33.000Z","size":23,"stargazers_count":126,"open_issues_count":3,"forks_count":16,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-21T05:04:30.790Z","etag":null,"topics":["autostart","launchctl","plist","startup-script"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/typicode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-03T01:38:00.000Z","updated_at":"2024-11-20T05:10:28.000Z","dependencies_parsed_at":"2022-09-19T02:30:20.682Z","dependency_job_id":null,"html_url":"https://github.com/typicode/user-startup","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typicode%2Fuser-startup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typicode%2Fuser-startup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typicode%2Fuser-startup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typicode%2Fuser-startup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/typicode","download_url":"https://codeload.github.com/typicode/user-startup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246557477,"owners_count":20796689,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autostart","launchctl","plist","startup-script"],"created_at":"2024-10-03T10:59:25.127Z","updated_at":"2025-04-03T02:11:42.179Z","avatar_url":"https://github.com/typicode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# user-startup [![Build Status](https://travis-ci.org/typicode/user-startup.svg)](https://travis-ci.org/typicode/user-startup) [![npm version](https://badge.fury.io/js/user-startup.svg)](https://www.npmjs.com/package/user-startup)\n\n\u003e Automatically run commands when the user logs in. Used in [hotel](https://github.com/typicode/hotel) and [stop-server](https://github.com/typicode/stop-server).\n\n  * __No admin privileges required__\n  * Cross-platform (OS X, Linux and Windows)\n\n## Install\n\n```\nnpm install user-startup --save\n```\n\n## Usage\n\nCreate a new instance.\n\n```js\nconst Startup = require('user-startup')\nlet startup\n\ntry {\n  startup = Startup()\n} catch (err) {\n  // Unsupported platform\n}\n```\n\nAdd startup script but doesn't spawn process. Use `create` to create startup file and process at the same time.\n\n```js\nstartup.create(\n  'my-script', // id\n  process.execPath, // cmd\n  ['/some/path/app.js'], // args\n  '/some/path/out.log' // out\n)\n```\n\nRemove startup script.\n\n```js\nstartup.remove('my-script')\n```\n\nNote: you should check that root isn't running this code to avoid startup scripts being created in root's home directory. Use [sudo-block](https://github.com/sindresorhus/sudo-block) or [is-root](https://github.com/sindresorhus/is-root).\n\n## API\n\n__Startup()__\n\nCreates a new instance.\nThrows an error if platform isn't OS X, Linux or Windows.\n\n__add(id, cmd[, args[, out]])__\n\n* `id \u003cString\u003e` id\n* `cmd \u003cString\u003e` command\n* `args \u003cArray\u003e` optional list of string arguments\n* `out \u003cString\u003e` optional path to output file (directory needs to exist before)\n\nCreates startup script.\n\n__create(id, cmd[, args[, out]])__\n\nCreates a startup script __and__ spawns process.\n\n__remove(id)__\n\nRemoves startup script.\n\n__dir__\n\nReturns startup script directory.\n\n__getFile(id)__\n\nReturns startup script path.\n\n## How it works\n\n* On OS X, it creates a `plist` file in  `~/Library/LaunchAgents`\n* On Linux, it creates a `desktop` file in `~/.config/autostart`\n* On Windows, it creates a `vbs` script in `AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup`\n\n## License\n\nMIT - [Typicode](https://github.com/typicode)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypicode%2Fuser-startup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftypicode%2Fuser-startup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypicode%2Fuser-startup/lists"}