Skip to content

SaveAsSync? #62

@kpetrow

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;

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