
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600Ć Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600Ć faster than humans.
A lightweight Gitlab based JSON database with Mongo-style API. Backed by gitbreaker and mingo.
npm i gitlab-db
import GitlabDB from 'gitlab-db'
// Instantiate a database
const db = new GitlabDB('apple', {
url: 'http://gitlab.example.com',
token: 'your_access_token',
repo: 'group/repo',
})
// Create a collection
db.createCollection('product')
// CRUD
db.collection('product').save({ name: 'iphone', v: '8', price: 699 })
db.collection('product').find({ name: 'iphone' })
db.collection('product').update({ name: 'iphone', v: '8' }, { price: 599 })
db.collection('product').remove({ name: 'iphone', v: '7' })
Repository structure will be:
āāā <repository root>
āāā apple
āĀ Ā āāā product.json
Note: As all APIs returns a promise. I highly recommend the async/await
statement like the following:
const result = await db.collection('product').save({ name: 'iphone', v: '8', price: 699 })
Instantiate a database.
String
Name of the database you want to create.Object
String
Specify gitlab url, eg: http://gitlab.example.com
.String
Specify your personal access token.String
Specify repository name and group belongs to, format: group/repo
.String
Optional, specify branch, default: main
.String
Specify your custom GitlabAPI like @gitbeaker/browser
.Create a collection.
String
Name of the collection you want to create.Array
Optional. Specifies default data of the collection about to be created.Connect to a collection.
String
Name of the collection you want to connect.Object
Optional settings.
String
Specify a key of the collection.Inserts a new document(or multiple documents). This method will returns the inserted document(s).
Object
| Array
A document or multiple documents to save to the collection.Returns like:
Insert single document:
{ added: 1, document: {...} }
Insert multiple documents:
{ added: 2, documents: [{...}, {...}] }
Note: it will return { added: 0 }
if a key is specified and the document that the key points to already exists.
Selects documents in a collection.
Object
Optional. Specifies selection filter using query operators. To return all documents in a collection, omit this parameter or pass an empty document ({}).Returns like:
[{ _id: 1, ... }]
Modifies an existing document or documents in a collection.
Object
The selection criteria for the update. The same query selectors as in the find() method are available.Object
The modifications to apply.Returns like:
{ updated: 2 }
Another usage, execute multiple updates at once to reduce gitlab requests:
db.collection(collectionName).update([
{ query: { id: 1 }, update: { v: 1 } },
{ query: { id: 2 }, update: { v: 2 } },
])
Removes documents from a collection.
Object
Specifies deletion criteria using query operators.Returns like:
{ removed: 1 }
Check if a collection exists.
String
Name of the collection you want to check.Returns like:
true
import { Gitlab } from '@gitbeaker/browser';
import GitlabDB from 'gitlab-db'
// Instantiate a database
const db = new GitlabDB('apple', {
url: 'http://gitlab.example.com',
token: 'your_access_token',
repo: 'group/repo',
}, Gitlab)
// ETC...
Config your environment variables GITLAB_URL
ACCESS_TOKEN
REPO
, and run tests with:
GITLAB_URL={your_gitlab_url} ACCESS_TOKEN={your_access_token} REPO={yourGroup/yourRepo} npm run test
FAQs
A lightweight GitLab based JSON database with Mongo-style API
We found that gitlab-db 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
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600Ć faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.