https://github.com/oliverspeir/isastro
https://github.com/oliverspeir/isastro
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/oliverspeir/isastro
- Owner: OliverSpeir
- Created: 2025-02-15T08:47:32.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-02-16T06:14:37.000Z (3 months ago)
- Last Synced: 2025-02-16T07:18:36.362Z (3 months ago)
- Language: TypeScript
- Size: 72.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# isAstro
https://isastro.pages.dev
Attempts to see if a website is made with Astro
Looks for:
1. Generator tag
2. use of Astro's scoped css markers
3. use of `data-astro-` attributes or `astro-` class
4. use of `_astro/` directoryAttempts to be fast and not download more than needed, but will try to wait for the entire head to get a good faith attempt to find the generator tag because it's nice to see the version
The main logic is in [lib/modules/server](./src/lib/modules/server/index.ts)
There are [some tests](./src/lib/test/index.ts) run with `pnpm test`
There is an `/api` route for JSON that will return
```js
{
url: string;
isAstro: boolean;
mechanism: string;
lastFetchedUrl?: string;
astroVersion?: string;
starlightVersion?: string;
}
```