{"id":21667248,"url":"https://github.com/luftywiranda13/has-lockfile","last_synced_at":"2025-04-12T01:32:25.009Z","repository":{"id":57261504,"uuid":"100021583","full_name":"luftywiranda13/has-lockfile","owner":"luftywiranda13","description":"Detect lockfiles in the working directory","archived":false,"fork":false,"pushed_at":"2020-06-03T09:19:57.000Z","size":293,"stargazers_count":3,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T21:12:30.270Z","etag":null,"topics":["check","detect","find","lock-file","lockfile","npm","npm-shrinkwrap","package-lock","package-lock-json","yarn","yarn-lock"],"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/luftywiranda13.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":"2017-08-11T10:39:38.000Z","updated_at":"2019-05-04T06:22:09.000Z","dependencies_parsed_at":"2022-08-25T03:00:40.221Z","dependency_job_id":null,"html_url":"https://github.com/luftywiranda13/has-lockfile","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luftywiranda13%2Fhas-lockfile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luftywiranda13%2Fhas-lockfile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luftywiranda13%2Fhas-lockfile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luftywiranda13%2Fhas-lockfile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luftywiranda13","download_url":"https://codeload.github.com/luftywiranda13/has-lockfile/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248504230,"owners_count":21115135,"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":["check","detect","find","lock-file","lockfile","npm","npm-shrinkwrap","package-lock","package-lock-json","yarn","yarn-lock"],"created_at":"2024-11-25T11:35:32.653Z","updated_at":"2025-04-12T01:32:24.976Z","avatar_url":"https://github.com/luftywiranda13.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# has-lockfile\n\n\u003e Detect lockfiles in the working directory\n\n[![Package Version](https://img.shields.io/npm/v/has-lockfile.svg?style=flat-square)](https://www.npmjs.com/package/has-lockfile)\n[![Downloads Status](https://img.shields.io/npm/dm/has-lockfile.svg?style=flat-square)](https://npm-stat.com/charts.html?package=has-lockfile\u0026from=2016-04-01)\n[![Build Status: Linux](https://img.shields.io/travis/luftywiranda13/has-lockfile/master.svg?style=flat-square)](https://travis-ci.org/luftywiranda13/has-lockfile)\n[![Coverage Status](https://img.shields.io/codecov/c/github/luftywiranda13/has-lockfile/master.svg?style=flat-square)](https://codecov.io/gh/luftywiranda13/has-lockfile)\n\nUseful for tools that need to know whether to use `yarn` or `npm`.\n\n## Installation\n\n```sh\nnpm install has-lockfile\n```\n\n## Usage\n\n```sh\n$ tree\n.\n├── bar\n│   ├── package-lock.json\n│   └── package.json\n├── baz\n│   ├── package.json\n│   └── yarn.lock\n├── foo\n│   ├── npm-shrinkwrap.json\n│   └── package.json\n├── qux\n│   ├── npm-shrinkwrap.json\n│   ├── package-lock.json\n│   ├── package.json\n│   └── yarn.lock\n└── package.json\n```\n\n```js\nconst hasLockfile = require('has-lockfile');\n\nhasLockfile();\n// =\u003e false\n\nhasLockfile('bar');\n//=\u003e true\n\nhasLockfile.lockfiles();\n//=\u003e []\n\nhasLockfile.lockfiles('bar');\n//=\u003e ['package-lock.json']\n\nhasLockfile.lockfiles('baz');\n//=\u003e ['yarn.lock']\n\nhasLockfile.lockfiles('foo');\n//=\u003e ['npm-shrinkwrap.json']\n\nhasLockfile.lockfiles('qux');\n//=\u003e ['package-lock.json', 'yarn.lock', 'npm-shrinkwrap.json']\n```\n\n## API\n\n### hasLockfile([cwd])\n\nReturns `boolean`.\n\n### hasLockfile.lockfiles([cwd])\n\nReturns `Array` of lockfiles.\n\n#### cwd\n\nType: `string`\u003cbr\u003e\nDefault: `process.cwd()`\n\nCurrent working directory.\n\n## Related\n\n* [has-package-lock](https://github.com/luftywiranda13/has-package-lock) － Check if a `package-lock.json` is present in the working directory\n* [has-shrinkwrap](https://github.com/luftywiranda13/has-shrinkwrap) － Check if `npm-shrinkwrap.json` is present in the working directory\n* [has-yarn](https://github.com/sindresorhus/has-yarn) － Check if a project is using Yarn\n* [pkg-man](https://github.com/luftywiranda13/pkg-man) － Detect which package manager that should be used\n\n## License\n\nMIT \u0026copy; [Lufty Wiranda](https://www.luftywiranda.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluftywiranda13%2Fhas-lockfile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluftywiranda13%2Fhas-lockfile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluftywiranda13%2Fhas-lockfile/lists"}