
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
Json2proto is a command line tool for converting some json files to protobuf's proto file.
Json2proto is a command line tool for converting some json files to protobuf's proto file.
json2proto���Ѷ���洢json������ļ���Ϊ[ProtoBuf](https://developers.google.com/protocol-buffers/)��proto�ļ���
���������һ��json����
p0 : {
"x" : 0,
"y" : 1
}
�����[ProtoBuf](https://developers.google.com/protocol-buffers/)����ʾ�������Ϳ����������ģ�
message Position1 {
optional int8 x = 1;
optional int8 y = 2;
}
��Ȼ�����������Ҳ���ܴ洢��������, ֻ�Ƕ��˸������ֶ�, �ַ����ͷ�Χ����һЩ���ѡ�
message Position2 {
optional int32 x = 1;
optional int32 y = 2;
optional int32 z = 3;
}
���ͬʱҪ�洢p0�������p1����
p1 : {
x : 0,
y : 1,
z : 2.5
}
��ô��С(�����ֶΣ� ��С��Χ������)�Ŀ���ͬʱ�������������������Ӧ���������ģ�
message Position3 {
optional uint8 x = 1;
optional uint8 y = 2;
optional float z = 3;
}
json2protoͨ�������е������ֶ�_title�� ��ȷ����Щ��������ͬһ�����ͣ� ��������С����������Щ��������͡�
����û��_title�ֶεĶ��� json2proto����ͨ��-a�������Զ����շ���·������_title��
npm install -g json2proto
Usage: json2proto [options] file
Options:
-h, --help Display this information.
-v, --version Print the compiler version.
-o, --output Set the output file name.
-a, --auto Automatically generate a title for unnamed object.
-p, --prefix Set the class name prefix, default prefix is json2proto
-n, --namespace Set the namespace, default namespace is json2proto
-t, --title_tag Specify the title_tag for searching class name, default title is "_title".
motion.json:
{
"rows": [
{
"motion_id": 11001,
"name": "���˼粿�³�",
"privileges": [
"owner",
"admin",
"user",
"guest"
],
"type": "����",
"category": "��"
},
{
"motion_id": 11002,
"name": "ֱ��粿�³�",
"privileges": [
"owner",
"admin",
"user",
"guest"
],
"type": "����",
"category": "��"
}
]
}
command line:
json2pb -omotion.proto -a motion.json
motion.proto:
syntax = "proto3";
package json2proto ;
message json2proto_motion {
repeated json2proto_motion_rows rows = 1;
}
message json2proto_motion_rows {
int32 motion_id = 1;
string name = 2;
repeated string privileges = 3;
string type = 4;
string category = 5;
}
����ԭʼjson�ļ��в�������_title�ֶΣ� ������-a�������Զ�������
motion.jot
{
"rows": [
{
"motion_id": 11001,
"name": "���˼粿�³�",
"privileges": [
"owner",
"admin",
"user",
"guest"
],
"type": "����",
"category": "��",
"_title": "json2proto_motion_rows"
},
{
"motion_id": 11002,
"name": "ֱ��粿�³�",
"privileges": [
"owner",
"admin",
"user",
"guest"
],
"type": "����",
"category": "��",
"_title": "json2proto_motion_rows"
}
],
"_title": "json2proto_motion"
}
FAQs
Json2proto is a command line tool for converting some json files to protobuf's proto file.
We found that json2proto 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.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.