petersirka / node-filestorage

Storage for storing uploaded files in node.js
MIT License
72 stars 12 forks source link

storage.insert is not a function #23

Closed cfirs closed 7 years ago

cfirs commented 7 years ago

hi, i try to use the basic function insert, this is my code:

import storage = require('filestorage'); storage.create('j:st'); storage.insert('a.txt', 'j:750M/a.txt','my custom data', function(err, id, stat) { console.log(id); console.log(stat);

// stat.name        - file name
// stat.extension   - file extension
// stat.length      - file length
// stat.type        - content type
// stat.width       - picture width
// stat.height      - picture height
// stat.custom      - your custom value
// stat.stamp       - date created ticks, new Date(stat.stamp)

}, 'new logo');

what i am doing worng?

petersirka commented 7 years ago
var mystorage = storage.create('j:st');
mystorage.insert('a.txt', 'j:750M/a.txt','my custom data', function(err, id, stat) {
});
cfirs commented 7 years ago

tnx, but now he look for callback' but i give him....

[DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.

petersirka commented 7 years ago

Try to use latest beta npm install filestorage@beta.

petersirka commented 7 years ago

I'll publish it today.