Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
alopex
Advanced tools
Readme
Easy to use data store. Can be used for persistent data in a sqlite file or just blazing fast in memory.
Features:
This libary is the NodeJS version of my favorite python module: https://dataset.readthedocs.io/en/latest/
Try it out on: https://npm.runkit.com/alopex
npm install -g npm@latest
npm install alopex --save
Giving up a database name to connect is optional. Default database if none given is ':memory:'
const alopex = require('alopex')
const dataSet = await alopex()
This code will create a new table called myNewTable
and will add the required fields automatically.
dataSet.myNewTable.insert({'name': 'John', 'surname': 'Snow'}).then(pk=>{
console.info('Inserted record has primary key', pk)
})
dataSet.myNewTable.find({'name': 'John'}, null).then(records=>{
console.info('Found records', records)
})
dataSet.myNewTable.find({'name': 'John'}, ['surname']).then(records=>{
console.info('Found records', records)
})
dataSet.myNewTable.find({'_orderBy': 'id'}).then(records=>{
console.info('Found records', records)
})
Descending sorting is done by adding -
in front of the column name.
dataSet.myNewTable.find({'_orderBy': '-id'}).then(records=>{
console.info('Found records', records)
})
dataSet.myNewTable.find({'_limit': 100}).then(records=>{
console.info('Found 100 records', records)
})
Using _offset without _limit is ignored.
dataSet.myNewTable.find({'_limit': 100, '_offset': 100}).then(records=>{
console.info('Found 100 records starting from offset 100', records)
})
dataSet.myNewTable.update({'name': 'John', 'id': 5}, ['id']).then(updateCount=>{
console.info('Updated records', updateCount)
})
dataSet.myNewTable.update({'name': 'John'}, {'surname__like': '%Snow%'}).then(updateCount=>{
console.info('Updated records', updateCount)
})
dataSet.myNewTable.delete({'name': 'John'}).then(changeCount=>{
console.info('Total deleted', changeCount)
})
dataSet.myNewTable.count({'name': 'John'}).then(total=>{
console.info('Total records matcing criteria', total)
})
Filters used below can be used by update, upsert, delete and count.
Example usage:
dataSet.myTable.find({'name__like': '%test%', 'age__isnull': false, 'id__gte': 5, '_orderBy': '-id', '_limit': 5, '_offset': 10})
Find record method creates indexes automatically. For example:
dataSet.find({'z': 1, 'y__eq': 2})
will create index idx_y_z
.
It only applies to fields filtered with =
operator.
Promise returns false if index already exist.
dataSet.myNewTable.createIndex(['age', 'length']).then(isIndexCreated=>{
console.info('Created new index is ', isIndexCreated)
})
FAQs
Databases for lazy people.
The npm package alopex receives a total of 18 weekly downloads. As such, alopex popularity was classified as not popular.
We found that alopex demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.