
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
@sl-code-lords/github-db
Advanced tools
github repository database
use github repository as database
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
yarn add @sl-code-lords/github-db
or
npm i @sl-code-lords/github-db
var Github_db = require('@sl-code-lords/github-db')
var config={ github_token: 'token', user_name:'user_name', repo:'test_github_db',is_private_repo:true }
var git = new Github_db(config)
const config = {
github_token, // your github token
user_name, // your github username
repo, // repo name for github db
commit_message, // commit massage
committer_mail, // mail of any github account for commit
committer_name, // name for committer
use_template, // if you have template repo use_template : 'username/repo'
is_private_repo // if true repo will gen as private
}
const is_conn = await git.connect()
//is_conn
true
//init new file
var File = git.File('hello.txt','Init','Files/')
// upload file to github
var init = await File.upload_data(Buffer.from('test file upload', 'utf-8'))
//delete File From Github
var del = await File.delete_file()
//init
true
//del
true
var password = '' // password for enc file method
//init new String Model
var session = git.stringModel('session','Init','DB/',password)
// add new string
var add = await session.update_data('Hello I Am Ravindu Manoj -')
// + add string
var second_add = await session.update_data('@ravindu01manoj')
// replace new string
var third_add = await session.update_data('replacement add',true)
// get data from model
var get_data = await session.get_data()
// delete model
var del = await session.delete_model()
//add
Hello I Am Ravindu Manoj -
//second_add
Hello I Am Ravindu Manoj -@ravindu01manoj
//third_add
replacement add
//get_data
replacement add
//del
true
var password = '' // password for enc file method
//init new Array Model
var list = git.arrayModel('list','Init','DB/',password)
// add new array
var add = await list.update_data([1,'mango'])
// + add array
var second_add = await list.update_data(['banana','apple'])
// replace new array
var third_add = await list.update_data(['cat','dog','ant'],true)
// get data from model
var get_data = await list.get_data()
// delete model
var del = await list.delete_model()
//add
[ 1, 'mango' ]
//second_add
[ 1, 'mango', [ 'banana', 'apple' ] ]
//third_add
[ 'cat', 'dog', 'ant' ]
//get_data
[ 'cat', 'dog', 'ant' ]
//del
true
var password = '' // password for enc file method
//init new Object Model
var item = git.objectModel('item','Init','DB/',password)
// add new object
var add = await item.update_data({name : 'Ravindu',age:'21'})
// + add object
var second_add = await item.update_data({country : 'sri_lanka',age:22,language : 'sinhala'})
// replace new object
var third_add = await item.update_data({game:'cricket',year: 2023},true)
// get data from model
var get_data = await item.get_data()
// delete model
var del = await item.delete_model()
//add
{ name: 'Ravindu', age: '21' }
//second_add
{ name: 'Ravindu', age: 22, country: 'sri_lanka', language: 'sinhala' }
//third_add
{ game: 'cricket', year: 2023 }
//get_data
{ game: 'cricket', year: 2023 }
//del
true
See also the list of contributors who participated in this project.
FAQs
github repository database
We found that @sl-code-lords/github-db demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.