
Security News
The Code You Didn't Write Is Still Yours to Defend
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.
@avro/common-types
Advanced tools
Pure JavaScript implementation of the Avro specification.
$ npm install @avro/types
@avro/types is compatible with all versions of node.js since 0.11.
Inside a node.js module, or using browserify:
const {Type} = require('@avro/types');
Encode and decode values from a known schema:
const type = Type.forSchema({
type: 'record',
fields: [
{name: 'kind', type: {type: 'enum', symbols: ['CAT', 'DOG']}},
{name: 'name', type: 'string'}
]
});
const buf = type.toBuffer({kind: 'CAT', name: 'Albert'}); // Encoded buffer.
const val = type.fromBuffer(buf); // = {kind: 'CAT', name: 'Albert'}
Infer a value's schema and encode similar values:
const type = Type.forValue({
city: 'Cambridge',
zipCodes: ['02138', '02139'],
visits: 2
});
// We can use `type` to encode any values with the same structure:
const bufs = [
type.toBuffer({city: 'Seattle', zipCodes: ['98101'], visits: 3}),
type.toBuffer({city: 'NYC', zipCodes: [], visits: 0})
];
FAQs
Common Avro types
We found that @avro/common-types demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.