s1mple.js
Make JavaScript easier.
s1mple.js
Documentation.
Hello and welcome to Areas | Second Header |
---|---|
JSONbase | Local Databases Requirements, Structure, Commands, Usage |
S1ncrypt | Encryptor Requirements, Structure, Commands, Usage |
Get Started
To get started with simple.js
you will need to install it as a module by the following in your console :
npm install s1mple.js
Once s1mple.js
is installed you can include It on your project by typing the following in your code :
const s1mple = ;// The following is depending on what you want to include :const JSONbase = './database/JSONbase.json'; // You'd need to specify the pathconst s1ncrypt = 3; // Specify an extra number (To encrypt Further)
s1mple.js
: by yaxeldragon
and luis-dev
Areas :
JSONbase
Requirements (JSONbase)
In order to use this extention you will need a JSON file with an expected input {}
. You will also need to define your database.
const s1mple = ;const JSONbase = './database/JSONbase.json';// JSONbase.crea...
Structure (JSONbase)
This database system is organized by row
, items
, values
. A row contains items, and each item contains a value.
"row":
Commands (JSONbase)
Command | Action | ID |
---|---|---|
JSONbase.addRow('Row', ['items array']); |
Creates a row with all items |
JB#01 |
JSONbase.addItem('Row', 'Item'); |
Adds an item to a row. | JB#02 |
JSONbase.setItem('Row', 'Item', 'value'); |
Sets the value of an item | JB#03 |
JSONbase.removeRow('Row'); |
Removes a row with all Items |
JB#04 |
JSONbase.removeItem('Row', 'Item'); |
Removes an Item | JB#05 |
JSONbase.save(); |
Saves all changes. | JB#06 |
JSONbase.createBackup(); |
Creates a backup. | JB#07 |
JSONbase.saveBackup('Path'); |
Saves a backup into a custom file . |
JB#08 |
JSONbase.rowExists('Row'); |
Saves a backup into a custom file . |
JB#09 |
Usage (JSONbase)
JB#01
ID: Create a row (the base) with the following Command :
// Code (index.js)JSONbase;JSONbase; // Result (JSONbase.json)"s1mple.js": "commands": "" "classes": "" "more stuff...": ""
JB#02
ID: Add an item to a Row :
// Code (index.js)JSONbase;JSONbase;JSONbase; // Result (JSONbase.json)"s1mple.js": "commands": "" "classes": "" "more stuff...": "" "newItem": ""
JB#03
ID: Set the value of an item inside a Row.
// Code (index.js)JSONbase;JSONbase;JSONbase; // Result (JSONbase.json)"s1mple.js": "commands": "" "classes": "I am a class!" "more stuff...": ""
JB#04
ID: Removes a row. Including the items inside It.
// Code (index.js)JSONbase;JSONbase;JSONbase; // Result (JSONbase.json){}
JB#05
ID: Removes an Item inside a Row.
// Code (index.js)JSONbase;JSONbase;JSONbase; // Result (JSONbase.json)"s1mple.js": "commands": "" "more stuff...": ""
JB#06
ID: Saves all stored locally on the Database.
// Code (index.js)JSONbase;JSONbase; // Saves all changes done to JSONbase. // Result (JSONbase.json)"s1mple.js": "commands": "" "classes": "" "more stuff...": ""
JB#07
, and JB#08
ID: Creates a Backup.
// Code (index.js)JSONbase;JSONbase;JSONbase;JSONbase; // Result (JSONbase.json)"s1mple.js": "commands": "" "classes": "" "more stuff...": "" // Backup (myBackup.json)"s1mple.js": "commands": "" "classes": "" "more stuff...": ""
JB#09
ID: Checks if a row exists and returns a true
or false
(can be used in if
's statements)
// Code (index.js)JSONbase; // CREATES a Row.if JSONbase // If 'commands' row exits JSONbase; // Creates a Row. JSONbase; else JSONbase;// PD : If it exists // Result (JSONbase.json)"s1mple.js": "commands": "" "classes": "" "more stuff...": "" // Backup (myBackup.json)"s1mple.js": "commands": "" "classes": "" "more stuff...": ""
S1ncrypt
Requirements (S1ncrypt)
In order to use this extention you will need to insert the following in your code :
const s1ncrypt = 3;// You can plug any NUMBER for 3, It's an extra layer of encryption.
Structure (S1ncrypt)
(S1mple.js
Developers Secret)
Commands (S1ncrypt)
Command | Action | ID |
---|---|---|
JSONbase.encrypt('string', 'hexa-char'); |
Creates a row with all items |
s1yt#01 |
Usage (S1ncrypt)
s1yt#01
ID: Returns an encrypted Text :
let encrypted = s1ncrypt; // Don't change the method (hexa-char). That's the only one currentlyconsole; // Console Output :> 'MyString': 'M37My138yS53St125tr120ri96in109ng90g'
Versions
1.0.2 : Made
JSONbase
find file route easier, Check if Items exists, and auto-fix an unexpected JSON input. Also Introducings1ncrypt
to be able to encrypt strings with only two commands.