crud-json-array
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -28,4 +28,4 @@ "use strict"; | ||
fs.writeFileSync(this.full_table_name, JSON.stringify({ array: [cols] })); | ||
this.read_table_from_file(); | ||
} | ||
this.read_table_from_file(); | ||
}; | ||
@@ -44,3 +44,3 @@ Create.prototype.read_table_from_file = function () { | ||
}; | ||
Create.prototype.insert_row = function (row) { | ||
Create.prototype.insert_one_row = function (row) { | ||
// code to insrt row | ||
@@ -47,0 +47,0 @@ this.table.push(row); |
{ | ||
"name": "crud-json-array", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "This module is creating manipulating JSON array. That is create table, insert, update, select and delete. useful for small data", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -41,6 +41,23 @@ # crud-json-array | ||
``` | ||
## Code to create more than one table | ||
``` | ||
//below exmple shows way to create three table in side folder data | ||
var DB = require("crud-json-array"); | ||
var curTable_1 = new DB.CRUD("data"); | ||
curTable_1.create_table("fTable",["name", "age", "sex"]); | ||
var curTable_2 = new DB.CRUD("data"); | ||
curTable_2.create_table("fTable",["paper1", "paper2", "paper3"]); | ||
var curTable_3 = new DB.CRUD("data); | ||
curTable_3.create_table("fTable",["taet1", "test2", "test3"]); | ||
``` | ||
## insert row | ||
``` | ||
curDB.insert_row(["Rithik", 47, "male"]); | ||
curDB.insert_row(["Varun", 27, "male"]); | ||
curDB.insert_one_row(["Rithik", 47, "male"]); | ||
curDB.insert_one_row(["Varun", 27, "male"]); | ||
``` | ||
@@ -63,9 +80,11 @@ | ||
## read table (all) | ||
Two way to read | ||
1. from file `var tableFile = curDB.read_table_from_file();` | ||
2. from memory `var tableMemory = curDB.read_table_in_memory()` | ||
Two way to read | ||
1. from file `var tableFile = curDB.read_table_from_file();` | ||
2. from memory `var tableMemory = curDB.read_table_in_memory()` | ||
use in Momery as avoid from file method | ||
use in Momery as avoid from file method | ||
## get table name with path | ||
``` | ||
curDb.get_table_full_path_name | ||
``` |
@@ -39,4 +39,4 @@ /* | ||
fs.writeFileSync(this.full_table_name, JSON.stringify({array : [cols]})); | ||
this.read_table_from_file(); | ||
} | ||
this.read_table_from_file(); | ||
} | ||
@@ -59,3 +59,3 @@ | ||
insert_row(row:any[]){ | ||
insert_one_row(row:any[]){ | ||
// code to insrt row | ||
@@ -108,5 +108,12 @@ this.table.push(row); | ||
get_table_full_path_name(){ | ||
// returns this path and table name | ||
return this.full_table_name; | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
88
1
0
15423
10
222