Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Lowkie is a lokijs object modeling tool designed to work in an asynchronous environment.
$ npm i lowkie
//lowkie singleton
const lowkie = require('lowkie');
//connect to lowkie (includes loki connection configuration), options can include other loki adapters besides structured file adapters
lowkie.connect(path.join(__dirname, './sampledb.json'),options)
.then((db) => {
console.log('connected db');
})
.catch(e => {
console.log('connection error', e);
});
//listen for connection errors
lowkie.connection.on('connectionError', (e)=>{
console.log('error connecting to the db',e);
});
//listen for connecting status, dbname is the path to the db json file
lowkie.connection.on('connecting', (dbname, options)=>{
console.log('now trying to connect to db');
});
//once connected, create models, query the db, etc
lowkie.connection.once('connected', (db, options)=>{
console.log('now connected to db');
//create a new schema
const UserSchema = lowkie.Schema({
email:String,
username:String,
age:Number,
});
//register db models, each model is a proxied loki collection with additional helpers
const User = lowkie.model('User',UserSchema);
//write data to db
User.insert({
email:'test@domain.com',
username:'testuser',
age:30,
invalidProp:'whatever', //removes invalid schema props on creates
})
.then(newuser => {
//created db
/*
{
"_id":"fbd8080a9272ecaa15d1bb6d0f4b3314",
"email":"test@domain.com",
"username":"testuser",
"age":30,
"meta":{
"revision":0,
"created":1490576236063,
"version":0
},
"$loki":201
}
*/
console.log({ newuser });
})
.catch(e => {
console.log(e);
});
//insert multiple documents
User.insert([
{
email:'john@domain.com',
username:'jsmith',
age:37,
},
{
email:'jane@domain.com',
username:'jdoe',
age:45,
},
{
email:'chris@domain.com',
username:'clane',
age:17,
},
])
.then((newusers)=>{
console.log(newusers);
})
.catch(e =>{
console.log(e);
})
//query loki for data
let userQueryResults = User.find({ id: { '$gte': 1 } });
console.log({userQueryResults}) //result of user query
});
Make sure you have grunt installed
$ npm i -g grunt-cli jsdoc-to-markdown
For generating documentation
$ grunt doc
$ jsdoc2md lib/**/*.js index.js > doc/api.md
$ npm i
$ grunt test
fork and create a pull request!
MIT
FAQs
My Custom lowkie / Express Applcation
The npm package lowkie receives a total of 22 weekly downloads. As such, lowkie popularity was classified as not popular.
We found that lowkie 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.