Home / File/ collections.json.js — astro Source File

collections.json.js — astro Source File

Architecture documentation for collections.json.js, a javascript file in the astro codebase. 2 imports, 0 dependents.

File javascript CoreAstro RoutingSystem 2 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  1aa50b82_be3d_aa62_f3c7_26244646d0ea["collections.json.js"]
  48f80d01_e646_3924_78f6_a9d836644746["astro:content"]
  1aa50b82_be3d_aa62_f3c7_26244646d0ea --> 48f80d01_e646_3924_78f6_a9d836644746
  ca52ff61_c81f_c2ca_81b6_5a678b65fd31["devalue"]
  1aa50b82_be3d_aa62_f3c7_26244646d0ea --> ca52ff61_c81f_c2ca_81b6_5a678b65fd31
  style 1aa50b82_be3d_aa62_f3c7_26244646d0ea fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { getCollection, getEntry } from 'astro:content';
import * as devalue from 'devalue';

export async function GET() {
	const customLoader = await getCollection('blog', (entry) => {
		return entry.data.id < 6;
	});
	const jsonLoader = await getCollection('dogs');

	const dataEntry = await getEntry('dogs', 'beagle');

	const simpleLoader = await getCollection('cats');

	const entryWithReference = await getEntry('spacecraft', 'columbia-copy');
	const atlantis = await getEntry('spacecraft', 'atlantis');
	const referencedEntry = await getEntry(entryWithReference.data.cat);

	const spacecraft = await getCollection('spacecraft');

	const entryWithImagePath = await getEntry('spacecraft', 'lunar-module');

	const increment = await getEntry('increment', 'value');

	const images = await getCollection('images');

	const simpleLoaderObject = await getCollection('rodents')

	const probes = await getCollection('probes');

	const yamlLoader = await getCollection('fish');

	const tomlLoader = await getCollection('songs');

	const nestedJsonLoader = await getCollection('birds');
	
	const csvLoader = await getCollection('plants');
	
	const numbers = await getCollection('numbers');

	const numbersYaml = await getCollection('numbersYaml');

	const numbersToml = await getCollection('numbersToml');
	
	return new Response(
		devalue.stringify({
			customLoader,
			jsonLoader,
			dataEntry,
			simpleLoader,
			simpleLoaderObject,
			entryWithReference,
			entryWithImagePath,
			referencedEntry,
			increment,
			numbers,
			numbersYaml,
			numbersToml,
			images, 
			probes,
			yamlLoader,
			tomlLoader,
			nestedJsonLoader,
			csvLoader,
			atlantis,
			spacecraft: spacecraft.map(({id}) => id).sort((a, b) => a.localeCompare(b)),
		})
	);
}

Domain

Subdomains

Functions

Dependencies

  • astro:content
  • devalue

Frequently Asked Questions

What does collections.json.js do?
collections.json.js is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain, RoutingSystem subdomain.
What functions are defined in collections.json.js?
collections.json.js defines 1 function(s): GET.
What does collections.json.js depend on?
collections.json.js imports 2 module(s): astro:content, devalue.
Where is collections.json.js in the architecture?
collections.json.js is located at packages/integrations/cloudflare/test/fixtures/vite-plugin/src/pages/collections.json.js (domain: CoreAstro, subdomain: RoutingSystem, directory: packages/integrations/cloudflare/test/fixtures/vite-plugin/src/pages).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free