
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
twilight.db
Advanced tools
TwilightDB, verilerinizi farklı formatlarda depolamak ve yönetmek için esnek bir Node.js modülüdür. Bu modül sayesinde JSON, MySQL, BSON ve YAML gibi veritabanı formatlarını destekleyerek projenize uygun veri depolama seçenekleri sunar.
const { TwilightDB } = require('twilight.db');
// Örnek kullanım
const db = new TwilightDB('mydata.json', 'json');
/**
BSON formatında veritabanı
const dbBson = new TwilightDB('mydata.bson', 'bson');
**/
/**
YAML formatında veritabanı
const dbYaml = new TwilightDB('mydata.yaml', 'yaml');
**/
/**
Mysql formatında veritabanı
const mysql = require('mysql'); // twilight.db nin hemen altına yapıştırcan
const config = {
host: 'localhost', // MySQL sunucusunun adresi
port: 3306, // Bağlantı noktası
user: 'kullaniciadi', // MySQL kullanıcı adı
password: 'sifre', // MySQL kullanıcı şifresi
database: 'veritabani', // Bağlanmak istediğiniz veritabanının adı
};
const connection = mysql.createConnection(config);
connection.connect((err) => {
if (err) {
console.error('Bağlantı hatası:', err);
} else {
console.log('MySQL sunucusuna bağlandı!');
// Bağlantı başarılı bir şekilde kurulduğunda burada işlemlerinizi yapabilirsiniz.
}
});
**/
// Veri oluşturma
db.create('name', 'Luppux');
db.create('age', 25);
// Veri okuma
console.log(db.read('name')); //
// Veri güncelleme
db.update('age', 30);
console.log(db.read('age')); // 30
// Veri silme
db.delete('age');
console.log(db.read('age')); // undefined
// Veri sorgulama
const results = db.query((key, value) => value.includes('J'));
console.log(results); // [['name', 'Luppux']]
// MySQL bağlantısı kapatma
db.closeConnection();
// İndeksleme
db.createIndex('name');
const indexValues = db.getIndexValues();
console.log(indexValues); // ['Luppux']
// Transaksiyonlar
db.startTransaction();
db.set('name', 'Luppux');
db.set('age', 35);
db.commitTransaction();
console.log(db.read('name')); // Jane Smith
console.log(db.read('age')); // 35
// Veritabanı yedekleme ve geri yükleme
db.backup('backup.json');
db.restore('backup.json');
console.log(db.read('name')); // Luppux
// Diğer işlemler
db.createCollection('users'); // Yeni bir koleksiyon oluşturur
db.insert('users', { name: 'Alice', age: 30 }); // Koleksiyona yeni bir belge ekler
db.find('users', { age: { $gt: 25 } }); // Belirli bir koşula göre belgeleri bulur
db.updateOne('users', { name: 'Alice' }, { $set: { age: 31 } }); // Belirli bir belgeyi günceller
db.deleteOne('users', { name: 'Alice' }); // Belirli bir belgeyi siler
db.aggregate('users', [{ $group: { _id: '$age', count: { $sum: 1 } } }]); // Agregasyon işlemi yapar
// ...
npm install twilight.db
veya
yarn add twilight.db
Daha fazla bilgi için GitHub sayfamızı !ziyaret edebilirsiniz.
FAQs
Créated By Weatrix
The npm package twilight.db receives a total of 16 weekly downloads. As such, twilight.db popularity was classified as not popular.
We found that twilight.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
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.