Skip to content

SaveAsSync? #62

Description

@kpetrow

I needed to implement a SaveAsSync due to using a jbin in a module that couldn't work well with a call back. I can add a PR to implement a SaveAsSync if any interest.

return proto.saveAsSync = promising(function(dest, mimeType, callback) {
       if ("string" == typeof dest) {
           var buffer = this.read("blob", 0);
           is(buffer, Buffer) || (buffer = new Buffer(buffer)), require("fs").writeFileSync(dest, buffer);
       } else callback(new TypeError("Unsupported storage type."));
   }), jBinary;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions