Last active
April 5, 2016 18:50
-
-
Save raliste/16c43ddc6cd706bd2435508ea84edfb8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// esto lo podrias hacer en el archivo de file retrieval | |
var storage = require('./utils/storage'); | |
var files_path = join(common.system.paths.config, 'files.db'); | |
storage.init(files_path); | |
var una_funcion = function(cb) { | |
// Guardar un dato | |
storage.set('nombre_del_archivo', {ultimo_byte: 321321, otra_info: "hola"}, cb); | |
// Obtener un dato | |
storage.get('nombre_del_archivo'); // {ultimo_byte: 321321, otra_info: "hola"} | |
// Borrar un dato | |
storage.del('nombre_del_archivo'); | |
// Obtener todos los datos | |
storage.all(function(err, obj) { | |
console.log(obj) // nombre_del_archivo | |
console.log(storage.get(obj)) // {ultimo_byte: 321321, otra_info: "hola"} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment