Created
November 28, 2025 08:32
-
-
Save LekoArts/5b88a24933023d6eb814c388898059ee to your computer and use it in GitHub Desktop.
Checking dist-tags for npm packages (and creating a table for `latest` and two pre-release tags)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { exec } from 'child_process'; | |
| import { promisify } from 'util'; | |
| const execAsync = promisify(exec); | |
| const mastraPackages = [ | |
| '@mastra/auth-auth0', | |
| '@mastra/auth-clerk', | |
| '@mastra/auth-firebase', | |
| '@mastra/auth-supabase', | |
| '@mastra/auth-workos', | |
| '@mastra/ai-sdk', | |
| '@mastra/client-js', | |
| '@mastra/react', | |
| '@mastra/deployer-cloud', | |
| '@mastra/deployer-cloudflare', | |
| '@mastra/deployer-netlify', | |
| '@mastra/deployer-vercel', | |
| '@mastra/dane', | |
| '@mastra/longmemeval', | |
| '@mastra/arize', | |
| '@mastra/braintrust', | |
| '@mastra/langfuse', | |
| '@mastra/langsmith', | |
| '@mastra/observability', | |
| '@mastra/otel-bridge', | |
| '@mastra/otel-exporter', | |
| '@mastra/posthog', | |
| '@mastra/agent-builder', | |
| '@mastra/auth', | |
| 'mastra', | |
| '@mastra/codemod', | |
| '@mastra/core', | |
| 'create-mastra', | |
| '@mastra/deployer', | |
| '@mastra/evals', | |
| '@mastra/fastembed', | |
| '@mastra/loggers', | |
| '@mastra/mcp', | |
| '@mastra/mcp-docs-server', | |
| '@mastra/mcp-registry-registry', | |
| '@mastra/memory', | |
| '@mastra/playground-ui', | |
| '@mastra/rag', | |
| '@mastra/schema-compat', | |
| '@mastra/server', | |
| '@mastra/google-cloud-pubsub', | |
| '@mastra/express', | |
| '@mastra/hono', | |
| '@mastra/astra', | |
| '@mastra/chroma', | |
| '@mastra/clickhouse', | |
| '@mastra/cloudflare', | |
| '@mastra/cloudflare-d1', | |
| '@mastra/convex', | |
| '@mastra/couchbase', | |
| '@mastra/dynamodb', | |
| '@mastra/lance', | |
| '@mastra/libsql', | |
| '@mastra/mongodb', | |
| '@mastra/mssql', | |
| '@mastra/opensearch', | |
| '@mastra/pg', | |
| '@mastra/pinecone', | |
| '@mastra/qdrant', | |
| '@mastra/s3vectors', | |
| '@mastra/turbopuffer', | |
| '@mastra/upstash', | |
| '@mastra/vectorize', | |
| '@mastra/voice-azure', | |
| '@mastra/voice-cloudflare', | |
| '@mastra/voice-deepgram', | |
| '@mastra/voice-elevenlabs', | |
| '@mastra/voice-gladia', | |
| '@mastra/voice-google', | |
| '@mastra/voice-google-gemini-live', | |
| '@mastra/voice-murf', | |
| '@mastra/voice-openai', | |
| '@mastra/voice-openai-realtime', | |
| '@mastra/voice-playai', | |
| '@mastra/voice-sarvam', | |
| '@mastra/voice-speechify', | |
| '@mastra/inngest' | |
| ]; | |
| async function getDistTags(packageName) { | |
| try { | |
| const { stdout } = await execAsync(`npm view ${packageName} dist-tags --json`); | |
| return JSON.parse(stdout); | |
| } catch (error) { | |
| return null; // Package might not exist or have no tags | |
| } | |
| } | |
| async function main() { | |
| let completed = 0; | |
| const results = await Promise.all( | |
| mastraPackages.map(async (pkg) => { | |
| const tags = await getDistTags(pkg); | |
| completed++; | |
| process.stderr.write(`\rFetched ${completed}/${mastraPackages.length}`); | |
| return { | |
| package: pkg, | |
| latest: tags?.latest || '-', | |
| beta: tags?.beta || '-', | |
| alpha: tags?.alpha || '-' | |
| }; | |
| }) | |
| ); | |
| console.log('\n'); | |
| // Calculate column widths | |
| const packageWidth = Math.max(...results.map(r => r.package.length), 7); | |
| const latestWidth = Math.max(...results.map(r => r.latest.length), 6); | |
| const betaWidth = Math.max(...results.map(r => r.beta.length), 4); | |
| const alphaWidth = Math.max(...results.map(r => r.alpha.length), 5); | |
| // Print header | |
| console.log( | |
| 'Package'.padEnd(packageWidth) + ' | ' + | |
| 'Latest'.padEnd(latestWidth) + ' | ' + | |
| 'Beta'.padEnd(betaWidth) + ' | ' + | |
| 'Alpha'.padEnd(alphaWidth) | |
| ); | |
| console.log('-'.repeat(packageWidth + latestWidth + betaWidth + alphaWidth + 9)); | |
| // Print rows | |
| for (const row of results) { | |
| console.log( | |
| row.package.padEnd(packageWidth) + ' | ' + | |
| row.latest.padEnd(latestWidth) + ' | ' + | |
| row.beta.padEnd(betaWidth) + ' | ' + | |
| row.alpha.padEnd(alphaWidth) | |
| ); | |
| } | |
| } | |
| main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment