Comparing version 0.0.4 to 0.0.5
17
index.js
@@ -5,2 +5,11 @@ const fs = require('fs'); | ||
// criar uma pasta para armazenar os dados | ||
ldb.createDB = (path, name, callback)=>{ | ||
fs.mkdir(`${path}/${name}`, { recursive: true }, (err)=>{ | ||
if(err) throw err; | ||
if(callback) callback(); | ||
}); | ||
} | ||
// criar arquivo | ||
@@ -35,3 +44,11 @@ ldb.createDBFile = (path, file, callback)=>{ | ||
// clonar os dados de um arquivos | ||
ldb.cloneDBFile = (path, file, toPath, toFile, callback)=>{ | ||
fs.copyFile(`${path}/${file}.ldb`, `${toPath}/${toFile}.ldb`, (err)=>{ | ||
if(err) throw err; | ||
if(callback) callback(); | ||
}); | ||
} | ||
// sobrescrever dados | ||
@@ -38,0 +55,0 @@ ldb.overwriteData = (path, file, content, callback)=>{ |
{ | ||
"name": "ldbjs", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Create and manage local db files and data", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2283
64