@duper-js/node
v0.1.1
Published
Node.JS bindings for Duper, the format that's super!
Maintainers
Readme
Duper support for Node.JS.
Check out the official website for Duper.
Installation
npm install --save @duper-js/nodeExamples
import { parse, stringify } from "@duper-js/node";
const duper_data = `
APIResponse({
status: 200,
headers: {
content_type: "application/duper",
cache_control: "max-age=3600",
},
body: {
users: [
User({
id: Uuid("7039311b-02d2-4849-a6de-900d4dbe9acb"),
name: "Alice",
email: Email("[email protected]"),
roles: ["admin", "user"],
metadata: {
last_login: Instant('2024-01-15T10:30:00Z'),
ip: IPV4("173.255.230.79"),
},
}),
],
},
})
`;
const obj = parse(duper_data);
console.log(stringify, { stripIdentifiers: false });
console.log(JSON.stringify(obj));