Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@netrunner/pbf-ts
Advanced tools
Readme
Creates interface schema and encoder/decoder for protobuf.
The CLI is very simple:
pbfts [source dir] [target dir] file1.proto file2.proto ...
After parsing the protobuf schema the program will create an interface, a encoder and a decoder for every message schema.
# src/myfile.proto
message Point {
required uint32 x = 1;
required uint32 y = 2;
optional uint32 z = 3;
}
It creates a file with the name of the message:
pbfts ./src ./lib myfile.proto
# => ./lib/Point.ts
export interface PointSchema {
x: number;
y: number;
z?: number;
}
export const Point = {
encode(obj: PointSchema): Buffer { ... },
decode(buf: Buffer | Uint8Array): PointSchema { ... }
};
You can also use the writer functions in your own code:
import { writeSchemaFile, writeSchemaFileSync } from "@netrunner/pbf-ts";
const pbfData = `
message User {
required uint32 id = 1;
required string name = 2;
required bytes salt = 3;
optional bytes hash = 4;
}
message Post {
required uint32 id = 1;
required uint32 user_id = 2;
required string title = 3;
required string description = 4;
}
`;
// synchronous file creation
writeSchemaFileSync(pbfData, {
// // default options
// indent: ' ',
// suffix: 'Schema',
// lineBreak: '\n',
// writeDir: './'
});
// => User.ts
// => Post.ts
(async () => {
// asynchronous file creation
await writeSchemaFile(pbfData, {
// // default options
// indent: ' ',
// suffix: 'Schema',
// lineBreak: '\n',
// writeDir: './'
});
// => User.ts
// => Post.ts
});
FAQs
protobuf cli to create typescript declaration files for typescript schemas.
The npm package @netrunner/pbf-ts receives a total of 8 weekly downloads. As such, @netrunner/pbf-ts popularity was classified as not popular.
We found that @netrunner/pbf-ts 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.