Socket
Socket
Sign inDemoInstall

wio.db

Package Overview
Dependencies
2
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.17 to 4.0.18

babel.config.js

10

.eslintrc.json
{
"parser": "@babel/eslint-parser",
"parserOptions": {

@@ -7,3 +8,4 @@ "ecmaVersion": 2017

"node": true,
"es6": true
"es6": true,
"commonjs": true
},

@@ -22,4 +24,4 @@ "rules": {

"valid-typeof": "error",
"default-case": "error",
"no-extra-bind": "error",
"no-eval": "error",
"no-eq-null": "error",

@@ -59,3 +61,3 @@ "no-labels": "error",

{
"code": 500
"code": 1000
}

@@ -65,3 +67,3 @@ ],

"error",
500
1000
],

@@ -68,0 +70,0 @@ "no-new-object": "error",

7

index.js

@@ -1,3 +0,4 @@

const Database = require("./src/main.js");
const JsonDatabase = require("./src/JsonProvider");
const DatabaseError = require("./src/Error");
const YamlDatabase = require("./src/YamlProvider");

@@ -9,6 +10,6 @@

module.exports = {
Database,
JsonDatabase,
YamlDatabase,
DatabaseError
};
{
"name": "wio.db",
"version": "4.0.17",
"version": "4.0.18",
"description": "Gözle okunabilir database modülü.",

@@ -10,3 +10,4 @@ "main": "index.js",

"scripts": {
"test": "clear && nodemon test/test.js"
"test": "clear && nodemon test/test.js",
"lint": "eslint src --fix"
},

@@ -20,6 +21,7 @@ "types": "types/index.d.ts",

"turkish",
"json"
"json",
"yaml"
],
"author": "wioenena.q",
"license": "ISC",
"license": "Apache-2.0",
"repository": {

@@ -30,5 +32,10 @@ "type": "git",

"dependencies": {
"lodash": "^4.17.21"
"lodash": "^4.17.21",
"yaml": "^1.10.2"
},
"devDependencies": {
"@babel/core": "^7.13.10",
"@babel/eslint-parser": "^7.13.10",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-proposal-private-methods": "^7.13.0",
"@types/lodash": "^4.14.168",

@@ -35,0 +42,0 @@ "@types/node": "^14.14.34",

@@ -11,2 +11,5 @@ ![Image](https://img.shields.io/npm/v/wio.db?color=%2351F9C0&label=Wio.db)

```
# News
Yaml Support<br>
- Json specific features have also been added to yaml

@@ -18,2 +21,3 @@ # Uyarı || Warning

## Nasıl Kullanılır? || how to use?
# TypeScript

@@ -25,5 +29,10 @@ ```typescript

```javascript
const { Database } = require("wio.db");
const db = new Database("myDatabase");
const {
JsonDatabase,
YamlDatabase
} = require("wio.db");
const db = new JsonDatabase("myDatabase");
const yamldb = new YamlDatabase("myDatabase");
// Data set | get

@@ -81,3 +90,3 @@ db.set("data1", 1);

console.log(db.totalDBSize);
console.log(Database.DBCollection);
console.log(JsonDatabase.DBCollection);

@@ -90,1 +99,2 @@

[İnstagram](https://www.instagram.com/wioenena.q/)
[Discord](https://discord.gg/8N4cq3weqU)

@@ -23,3 +23,3 @@ const green = (message) => `\x1b[32m${message}\x1b[0m`;

get name() {
return yellow(`[ WioDB ] => ${this.constructor.name}`)
return yellow(`[ WioDB ] => ${this.constructor.name}`);
}

@@ -26,0 +26,0 @@ }

@@ -13,3 +13,3 @@

declare module "wio.db" {
export class Database<V> {
export class JsonDatabase<V> {
public static DBCollection: Array<Database<unknown>>;

@@ -48,2 +48,37 @@ private databaseName: string;

export class YamlDatabase<V> {
public static DBCollection: Array<Database<unknown>>;
private databaseName: string;
public constructor(databaseName?: string);
private handle(): boolean;
private save(): boolean;
public set(key: string, value: V): V;
public get(key: string): V;
public fetch(key: string): V;
public exists(key: string): boolean;
public has(key: string): boolean;
public all(limit?: number): Array<{ ID: string, data: V }>;
public fetchAll(limit?: number): Array<{ ID: string, data: V }>;
public toJSON(limit?: number): Object;
public delete(key: string): void;
public deleteAll(): void;
public type(key: string): string | number | bigint | boolean | symbol | Array | undefined | object | Function;
public pull(key: string, value: V, multiple?: boolean): V;
public valueArray(): V[];
public keyArray(): string[];
public math(key: string, operator: "+" | "-" | "*" | "/" | "%", value: V, goToNegative?: boolean): V;
public add(key: string, value: V): V;
public substr(key: string, value: V): V;
public push<T>(key: string, value: T): V;
public arrayHasValue<T>(key: string, value: T | T[]): boolean | object;
public includes(key: string): object;
public startsWith(key: string): object;
public findAndDelete(callbackfn: (key: string, value: V) => boolean): number;
public destroy(): void;
public get size(): number;
public get totalDBSize(): number;
public get fileName(): string;
}
export class DatabaseError extends Error {

@@ -50,0 +85,0 @@ public constructor(message: string);

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc