An intro to decoders

1 · Vincent Driessen · Sept. 25, 2018, midnight
Today, I’m thrilled to publicly announce a new open source project that we’ve been using in production for months: ✨decoders ✨. To get started: $ npm install decoders Here’s a quick example of what decoders can do: import { guard, number, object, optional, string } from 'decoders'; // Define your decoder const decoder = object({ name: string, age: optional(number), }); // Build the runtime checker ("guard") once const verify = guard(decoder); // Use it const unsafeData = JSON.parse(requ...