
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Easy to use wrapper for sqlite databases, mainly designed for use with dbd.ts package.
Documentation can be found here
This is a small example of how you would create a database instance and a table with 2 columns with a primary column and a json column, connecting database and doing some operations with it.
const { Database, Column, Table } = require("dbdts.db")
const db = new Database({ path: "./db.sqlite" })
const table = db.createTable("mytable").addColumns([
new Column()
.setName("id")
.setPrimary(true)
.setType("TEXT"),
new Column()
.setName("json")
.setType("JSON")
.setDefault({})
])
db.once("ready", () => {
console.log(`Database is ready!`)
const changes = table.set({
id: "12345",
json: {
swords: 1,
hammers: 0
}
})
console.log(changes)
const results = table.get({
where: {
column: "id",
equals: "12345"
}
})
console.log(results)
const deletion = table.delete({
where: {
column: "id",
equals: "12345"
}
})
console.log(deletion)
const all = table.all()
console.log(all)
})
db.connect()
const { APIDatabase, Column } = require("dbdts.db")
//You will need to install axios yourself.
const axios = require("axios")
const table = db.createTable("mytable").addColumns([
new Column()
.setName("id")
.setPrimary(true)
.setType("TEXT"),
new Column()
.setName("json")
.setType("JSON")
.setDefault({})
])
const db = new APIDatabase({
port: 3444,
password: "youshallnotpass"
})
db.open(async () => {
console.log(`Database ready!`)
await axios.post(`${db.url}/set`, {
table: "mytable",
data: {
id: "12345",
json: {
swords: 1,
hammers: 0
}
},
options: {
where: {
column: "id",
equals: "12345"
}
}
}, {
headers: {
Authorization: db.options.password
}
})
const request = await axios.post(`${db.url}/get`, {
table: "mytable",
options: {
where: {
column: "id",
equals: "12345"
}
}
}, {
headers: {
Authorization: db.options.password
}
})
console.log(request.data)
})
FAQs
Easy to use wrapper for sqlite databases, mainly designed for use with dbd.ts package.
The npm package dbdts.db receives a total of 3 weekly downloads. As such, dbdts.db popularity was classified as not popular.
We found that dbdts.db demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.