{"id":13456395,"url":"https://github.com/netlify/framework-info","last_synced_at":"2025-10-03T15:31:04.532Z","repository":{"id":37926516,"uuid":"283489816","full_name":"netlify/framework-info","owner":"netlify","description":"Framework detection utility","archived":true,"fork":false,"pushed_at":"2023-01-10T13:51:35.000Z","size":48671,"stargazers_count":137,"open_issues_count":26,"forks_count":21,"subscribers_count":39,"default_branch":"main","last_synced_at":"2024-09-29T15:20:13.078Z","etag":null,"topics":["continuous-integration","dependency-management","deployment","es6","framework","gatsby","gulp","html","hugo","jamstack","javascript","library","markdown","netlify","nodejs","npmjs","package-manager","static-site","static-site-generator","webapp"],"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/netlify.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-29T12:13:10.000Z","updated_at":"2024-06-27T02:38:40.000Z","dependencies_parsed_at":"2023-02-08T19:00:58.430Z","dependency_job_id":null,"html_url":"https://github.com/netlify/framework-info","commit_stats":null,"previous_names":[],"tags_count":78,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netlify%2Fframework-info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netlify%2Fframework-info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netlify%2Fframework-info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netlify%2Fframework-info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netlify","download_url":"https://codeload.github.com/netlify/framework-info/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235146594,"owners_count":18943285,"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":["continuous-integration","dependency-management","deployment","es6","framework","gatsby","gulp","html","hugo","jamstack","javascript","library","markdown","netlify","nodejs","npmjs","package-manager","static-site","static-site-generator","webapp"],"created_at":"2024-07-31T08:01:21.180Z","updated_at":"2025-10-03T15:30:59.115Z","avatar_url":"https://github.com/netlify.png","language":"JavaScript","readme":"\u003e # **Important Notice**\n\u003e\n\u003e This repository was moved into the mono repository of [github.com/netlify/build](https://github.com/netlify/build) The\n\u003e package name and the versions are preserved!\n\n[![npm version](https://img.shields.io/npm/v/@netlify/framework-info.svg)](https://npmjs.org/package/@netlify/framework-info)\n[![Coverage Status](https://codecov.io/gh/netlify/framework-info/branch/main/graph/badge.svg)](https://codecov.io/gh/netlify/framework-info)\n[![Build](https://github.com/netlify/framework-info/workflows/Build/badge.svg)](https://github.com/netlify/framework-info/actions)\n[![Downloads](https://img.shields.io/npm/dm/@netlify/framework-info.svg)](https://www.npmjs.com/package/@netlify/framework-info)\n\nFramework detection utility.\n\nDetects which framework a specific website is using. The framework's build/dev commands, directories and server port are\nalso returned.\n\nThe following frameworks are detected:\n\n- Static site generators: Gatsby, Hugo, Jekyll, Next.js, Nuxt, Hexo, Gridsome, Docusaurus, Eleventy, Middleman,\n  Phenomic, React-static, Stencil, Vuepress, Assemble, DocPad, Harp, Metalsmith, Roots, Wintersmith\n- Front-end frameworks: create-react-app, Vue, Sapper, Angular, Ember, Svelte, Expo, Quasar\n- Build tools: Parcel, Brunch, Grunt, Gulp\n\nIf you're looking for a way to run `framework-info` via CLI check the\n[`build-info`](https://github.com/netlify/build-info) project.\n\n[Additions and updates are welcome!](#add-or-update-a-framework)\n\n# Example (Node.js)\n\n```js\nimport { listFrameworks, hasFramework, getFramework } from '@netlify/framework-info'\n\nconsole.log(await listFrameworks({ projectDir: './path/to/gatsby/website' }))\n// [\n//   {\n//     id: 'gatsby',\n//     name: 'Gatsby',\n//     category: 'static_site_generator',\n//     dev: {\n//       commands: ['gatsby develop'],\n//       port: 8000,\n//       pollingStrategies: [{ name: 'TCP' }, { name: 'HTTP' }]\n//     },\n//     build: {\n//       commands: ['gatsby build'],\n//       directory: 'public'\n//     },\n//     staticAssetsDirectory: \"static\",\n//     env: { GATSBY_LOGGER: 'yurnalist' },\n//     plugins: []\n//   }\n// ]\n\nconsole.log(await listFrameworks({ projectDir: './path/to/vue/website' }))\n// [\n//   {\n//     id: 'vue',\n//     name: 'Vue.js',\n//     category: 'frontend_framework',\n//     dev: {\n//       commands: ['npm run serve'],\n//       port: 8080,\n//       pollingStrategies: [{ name: 'TCP' }, { name: 'HTTP' }]\n//     },\n//     build: {\n//       commands: ['vue-cli-service build'],\n//       directory: 'dist'\n//     },\n//     env: {},\n//     plugins: []\n//   }\n// ]\n\nconsole.log(await hasFramework('vue', { projectDir: './path/to/vue/website' }))\n// true\n\nconsole.log(await getFramework('vue', { projectDir: './path/to/vue/website' }))\n// {\n//   id: 'vue',\n//   name: 'Vue.js',\n//   category: 'frontend_framework',\n//   dev: {\n//     commands: ['npm run serve'],\n//     port: 8080,\n//     pollingStrategies: [{ name: 'TCP' }, { name: 'HTTP' }]\n//   },\n//   build: {\n//     commands: ['vue-cli-service build'],\n//     directory: 'dist'\n//   },\n//   env: {},\n//   plugins: []\n// }\n```\n\n# Installation\n\n```bash\nnpm install @netlify/framework-info\n```\n\n# Usage (Node.js)\n\n## listFrameworks(options?)\n\n`options`: `object?`\\\n_Return value_: `Promise\u003cobject[]\u003e`\n\n### Options\n\n#### projectDir\n\n_Type_: `string`\\\n_Default value_: `process.cwd()`\n\nPath to the website's directory.\n\n### Return value\n\nThis returns a `Promise` resolving to an array of objects describing each framework. The array can be empty, contain a\nsingle object or several objects.\n\nEach object has the following properties.\n\n#### id\n\n_Type_: `string`\n\nId such as `\"gatsby\"`.\n\n## name\n\n_Type_: `string`\n\nFramework name such as `\"Gatsby\"`.\n\n#### category\n\n_Type_: `string`\n\nCategory among `\"static_site_generator\"`, `\"frontend_framework\"` and `\"build_tool\"`.\n\n#### dev\n\n_Type_: `object`\n\nInformation about the dev command.\n\n##### commands\n\n_Type_: `string[]`\n\nDev command. There might be several alternatives.\n\n##### port\n\n_Type_: `number`\n\nServer port.\n\n##### pollingStrategies\n\n_Type_: `object[]`\n\nPolling strategies to use when checking if the dev server is ready.\n\n#### build\n\n_Type_: `object`\n\nInformation about the build command.\n\n##### commands\n\n_Type_: `string[]`\n\nBuild command. There might be several alternatives.\n\n##### directory\n\n_Type_: `string`\n\nRelative path to the directory where files are built.\n\n#### staticAssetsDirectory\n\n_Type_: `string`\n\nDirectory where the framework stores static assets. Can be `undefined`.\n\n#### env\n\n_Type_: `object`\n\nEnvironment variables that should be set when calling the dev command.\n\n#### plugins\n\n_Type_: `string[]`\n\nA list of recommend Netlify build plugins to install for the framework.\n\n## hasFramework(frameworkId, options?)\n\n`options`: `object?`\\\n_Return value_: `Promise\u003cboolean\u003e`\n\nSame as [`listFramework()`](#listframeworksoptions) except only for a specific framework and returns a boolean.\n\n## getFramework(frameworkId, options?)\n\n`options`: `object?`\\\n_Return value_: `Promise\u003cobject\u003e`\n\nSame as [`listFramework()`](#listframeworksoptions) except the framework is passed as argument instead of being\ndetected. A single framework object is returned.\n\n# Usage (CLI)\n\n```bash\n$ framework-info [projectDirectory]\n```\n\nThis prints the ids of each framework.\n\nIf known is found, `unknown` is printed.\n\nAvailable flags:\n\n- `--long`: Show more information about each framework. The output will be a JSON array.\n\n# Add or update a framework\n\nEach framework is a JSON file in the `/src/frameworks/` directory. For example:\n\n```json\n{\n  \"id\": \"gatsby\",\n  \"name\": \"Gatsby\",\n  \"category\": \"static_site_generator\",\n  \"detect\": {\n    \"npmDependencies\": [\"gatsby\"],\n    \"excludedNpmDependencies\": [],\n    \"configFiles\": [\"gatsby-config.js\"]\n  },\n  \"dev\": {\n    \"command\": \"gatsby develop\",\n    \"port\": 8000,\n    \"pollingStrategies\": [{ \"name\": \"TCP\" }, { \"name\": \"HTTP\" }]\n  },\n  \"build\": {\n    \"command\": \"gatsby build\",\n    \"directory\": \"public\"\n  },\n  \"staticAssetsDirectory\": \"static\",\n  \"env\": { \"GATSBY_LOGGER\": \"yurnalist\" },\n  \"plugins\": []\n}\n```\n\nAll properties are required.\n\n## id\n\n_Type_: `string`\n\nId of the framework.\n\n## name\n\n_Type_: `string`\n\nName of the framework.\n\n## category\n\n_Type_: `string`\n\nOne of `\"static_site_generator\"`, `\"frontend_framework\"` or `\"build_tool\"`.\n\n## detect\n\n_Type_: `object`\n\nInformation used to detect this framework\n\n### npmDependencies\n\n_Type_: `string[]`\n\nFramework's npm packages. Any project with one of those packages in their `package.json` (`dependencies` or\n`devDependencies`) will be considered as using the framework.\n\nIf empty, this is ignored.\n\n### excludedNpmDependencies\n\n_Type_: `string[]`\n\nInverse of `npmDependencies`. If any project is using one of those packages, it will not be considered as using the\nframework.\n\nIf empty, this is ignored.\n\n### configFiles\n\n_Type_: `string[]`\n\nFramework's configuration files. Those should be paths relative to the [project's directory](#projectdir). Any project\nwith one of configuration files will be considered as using the framework.\n\nIf empty, this is ignored.\n\n## dev\n\n_Type_: `object`\n\nParameters to detect the dev command.\n\n### command\n\n_Type_: `string`\n\nDefault dev command.\n\n### port\n\n_Type_: `number`\n\nLocal dev server port.\n\n### pollingStrategies\n\n_Type_: `object[]`\n\nPolling strategies to use when checking if the dev server is ready.\n\n## build\n\n_Type_: `object`\n\nParameters to detect the build command.\n\n### command\n\n_Type_: `string`\n\nDefault build command.\n\n### directory\n\n_Type_: `string`\n\nDirectory where built files are written to.\n\n## staticAssetsDirectory\n\n_Type_: `string`\n\nDirectory where the framework stores static assets where relevant for the framework.\n\n## env\n\n_Type_: `object`\n\nEnvironment variables that should be set when running the dev command.\n\n## plugins\n\n_Type_: `object[]`\n\nA list of Netlify build plugins package names and conditions. If a condition is met for a plugin it will be returned in\nthe framework's plugin's list.\n\nFor example\n\n```json\n{\n  \"plugins\": [\n    {\n      \"packageName\": \"@netlify/plugin-nextjs\",\n      \"condition\": { \"minNodeVersion\": \"10.13.0\" }\n    }\n  ]\n}\n```\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetlify%2Fframework-info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetlify%2Fframework-info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetlify%2Fframework-info/lists"}