Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.law4devs.eu/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Frameworks are the top-level objects in Law4Devs. Each framework represents one EU regulatory act (e.g. GDPR, NIS2, CRA) and acts as a namespace for articles, recitals, requirements, and annexes.

Methods

list()

Returns a page of framework summaries.
const page = await client.frameworks.list({ page: 1, perPage: 20 });

console.log(`${page.meta.total} frameworks across ${page.meta.pages} pages`);

for (const fw of page.data) {
  console.log(`${fw.slug}: ${fw.name} (${fw.articleCount} articles)`);
}
Parameters
ParameterTypeDefaultDescription
pagenumber1Page number
perPagenumber20Items per page (1–100)
Returns Promise<Page<Framework>>

get()

Fetch the full detail of a single framework by its slug.
const gdpr = await client.frameworks.get('gdpr');

console.log(gdpr.name);
console.log(`Coverage: ${gdpr.coverage}%`);
console.log(`EUR-Lex: ${gdpr.eurLexUrl}`);
Parameters
ParameterTypeDescription
slugstringFramework slug, e.g. "gdpr", "nis2", "cra"
Returns Promise<FrameworkDetail>

iter()

Iterate over all frameworks without managing pagination.
for await (const fw of client.frameworks.iter({ perPage: 50 })) {
  console.log(`${fw.shortName} — last synced: ${fw.lastSyncedAt}`);
}
Parameters — same options as list() (except page, which is managed internally). Returns AsyncGenerator<Framework>

Models

Framework

Returned by list() and iter().
FieldTypeDescription
idnumberInternal numeric ID
slugstringURL-safe identifier, e.g. "gdpr"
namestringFull official name
shortNamestringShort name, e.g. "GDPR"
celexNumberstring | nullEUR-Lex CELEX identifier
descriptionstring | nullPlain-text summary
isActivebooleanWhether the framework is published
statusstring"active", "superseded", or "draft"
expectedArticlesnumber | nullTarget article count for sync progress
expectedRecitalsnumber | nullTarget recital count for sync progress
lastSyncedAtstring | nullISO 8601 timestamp of last content sync
createdAtstringISO 8601 creation timestamp
articleCountnumberNumber of articles currently in the database
recitalCountnumberNumber of recitals currently in the database

FrameworkDetail

Returned by get(). Extends Framework with:
FieldTypeDescription
eurLexUrlstring | nullDirect link to EUR-Lex source document
requirementCountnumberNumber of extracted requirements
annexCountnumberNumber of annexes
tagCountnumberNumber of tags applied
coveragenumberSync coverage percentage (0–100)

Example: filter active frameworks

const activeFrameworks: string[] = [];

for await (const fw of client.frameworks.iter()) {
  if (fw.isActive && fw.status === 'active') {
    activeFrameworks.push(fw.slug);
  }
}

console.log('Active frameworks:', activeFrameworks.join(', '));
NIS1 has status: "superseded" and remains browsable for historical reference. Filter by status === "active" if you only want current legislation.