-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Added a more API-like interface to pbjs and pbts #1140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: cromefire <tim.l@nghorst.net>
Signed-off-by: cromefire <tim.l@nghorst.net>
Signed-off-by: cromefire <tim.l@nghorst.net>
You can now do: import {pbjs} from "protobufjs/cli/pbjs";
import {promisify} from "util";
const pbjsAsync = pomisify(pbjs)
pbjs({encode: false}, {content: "syntax = \"proto3\";", name: "foo.proto"}, () => {
// do something
})
// or
async function doSomething() {
const js = await pbjsAsync({encode: false}, {content: "syntax = \"proto3\";", name: "foo.proto"})
// do something
} Same for |
Signed-off-by: cromefire <tim.l@nghorst.net>
Also the |
Signed-off-by: cromefire <tim.l@nghorst.net>
Signed-off-by: cromefire <tim.l@nghorst.net>
Signed-off-by: cromefire <tim.langhorst@outlook.de>
# Conflicts: # package-lock.json
Is there anything blocking this from being merged @alexander-fenster ? |
@cromefire Just the lack of my free time - apologize for that! I'll go ahead and review/merge later this week. I do use |
The best thing is that you don't have to save the file, but you can retrieve it as |
For easier usage in things like gulp