{"id":19068822,"url":"https://github.com/cutenode/mingine","last_synced_at":"2025-04-28T14:07:30.785Z","repository":{"id":57297519,"uuid":"237284471","full_name":"cutenode/mingine","owner":"cutenode","description":"A module to get the minimum usable engine(s)","archived":false,"fork":false,"pushed_at":"2021-01-05T01:02:07.000Z","size":46,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-28T14:07:25.311Z","etag":null,"topics":["engines","node","nodejs","package-json","package-lock","reliability","supoort"],"latest_commit_sha":null,"homepage":null,"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/cutenode.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":"2020-01-30T19:03:23.000Z","updated_at":"2023-02-15T16:08:21.000Z","dependencies_parsed_at":"2022-09-01T08:40:52.638Z","dependency_job_id":null,"html_url":"https://github.com/cutenode/mingine","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cutenode%2Fmingine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cutenode%2Fmingine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cutenode%2Fmingine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cutenode%2Fmingine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cutenode","download_url":"https://codeload.github.com/cutenode/mingine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251326841,"owners_count":21571635,"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":["engines","node","nodejs","package-json","package-lock","reliability","supoort"],"created_at":"2024-11-09T01:12:08.900Z","updated_at":"2025-04-28T14:07:30.758Z","avatar_url":"https://github.com/cutenode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mingine\n\nA Node.js module to understand your dependencies `engines`.\n\n## Usage\n\nFirst, you'll need to install mingine:\n\n```sh\nnpm i mingine\n```\n\nNext, you'll want to require and use mingine. Requring mingine returns a promise that resolves an object.\n\n```js\nconst mingine = require('mingine')\n\nasync function getNodeMinimumEngine () {\n  const engines = await mingine() // mingine returns a promise\n\n  console.log(engines.node ? engines.node.minimum : undefined) // will log the minimum usable version of node.js if there were any `engines` that included `node`, otherwise it'll return undefined\n}\n\ngetNodeMinimumEngine()\n```\n\n## `mingine(options)`\n\n* `options` object (optional) - An object that acts as a courrier of options to [Arborist][]. Currently, only `path` is actively used.\n  * `path` string (optional) - where to search for node_modules. defaults to the current working directory.\n\nReturns `promise` - a promise that resolves an object, which represents the strucutre of engines. See [Returned Object Structure][] for more context on the shape of this object.\n\nCalling `mingine()` by itself will return a promise that resolves an object. It searches the current working directory's `node_modules` to do so. Calling `mingine(options)` where `options` is an object and has the property `path`, the value of `path` will be used as the directory to search for `node_modules`.\n\n## Returned Object Structure\n\nThe _structure_ of mingine's API is consistent, but the properties will not be. Mingine collects the `engine` property from every package inside of `node_modules` and then dynamically builds an object that includes every property within `engines` it encountered. It makes no assurances that any given property will exist since there's no gaurantee that a property may exist within `node_modules`.\n\nThe general structure will be:\n\n- `${engineName}` object - an object where the key is the name encountered inside of the `engines` property of a given package.json. Examples: `node`, `npm`\n  - `versions` object - an object that will always be identified as `versions` that contains arrays that represent each `${version}` of `${engineName}`\n    - `${version}` array - an array where the key is either a **valid** semver version OR any other string - even if it's not a valid semver version - since people do weird things with engines. In the future this may be tweaked/audited. Examples: `1.4.2`, `10.0.0`, `8.2.0`\n      - `${package}` string - strings that represent the package names of packages that included `${version}` as the value for `${engineName}` in their package.json. Examples: `webpack`, `react`, `qs`, `request`\n  - `minimum` string - a string that includes the _minimum usable version_ of `${engineName}` given the context collected from the `engines` property of all package.json files within `node_modules`.\n\n  An example of JSON output can be found at [./examples/everything-output.json][]\n\n  [./examples/everything-output.json]:./examples/everything-output.json\n  [Arborist]:https://www.npmjs.com/package/@npmcli/arborist\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcutenode%2Fmingine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcutenode%2Fmingine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcutenode%2Fmingine/lists"}