
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@hv/datoloader
Advanced tools
Downloads all data from DatoCMS. Data will be simplified. Typescript can be generated.
import { writeFile } from 'fs/promises';
import { Loader, generateTypescript } from '@hv/datoloader';
const loader = new Loader(process.env.DATO_API_KEY, {
onUpdate,
languages: { de: ['en'] },
});
loader.start();
async function onUpdate(data) {
await writeFile('data.json', JSON.stringify(data, null, 2));
await writeFile('data.ts', generateTypescript(firstLang));
}
Options:
export interface Options {
onUpdate: (payload: Result) => void | null
watch: boolean // keep watching for changes, onUpdate will be called again
changeKey: (key: string) => string // how to change the keys of the data (default: camelcase)
languages?: string[] | { [language: string]: string[] } // langauge: fallbackLanguages
itemVersion: boolean // include item version?
itemCreatedAt: boolean // include item createdAt?
itemUpdatedAt: boolean // include item updatedAt?
environment?: string
draft?: boolean
headers?: Record<string, string>
}
Please note that the resulting data will be simplified to someting like this:
{
"de": {
"itemType": {
"anotherBlock": {
"fields": {
"title": {
"type": "string",
"localized": false,
"required": false
}
}
}
},
"site": {
"name": "Boilerplate",
...
},
"upload": {
"54053638": {
"_id": "54053638",
"size": 9207613,
"width": 3840,
"height": 2160,
"url": "https://www.datocms-assets.com/99255/1682668783-weitsicht-3840x2160.png",
...
}
},
"item": {
"146161091": {
"_id": "146161091",
"_type": "anotherBlock",
"title": "Just Another",
"_updatedAt": "2023-04-28T08:02:27.684Z",
"_createdAt": "2023-04-28T08:02:27.680Z",
"_version": 267617551
}
}
}
}
Later, you can use the generated data and typescript like this:
import { readFile } from 'fs/promises';
import { Result, resolve } from '@hv/datoloader';
export async function loadData() {
const data = JSON.parse(await readFile('data.json'));
return resolve(data) as Result;
}
Resolving will link actual items to their references. So anything like items: ["23434232", "23423423"] will be resolved to items: [{_id: "23434232", ...}, {_id: "23423423", ...}].
FAQs
Dato Loader ===========
We found that @hv/datoloader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.