open-index/open-npm huggingface dataset:
npm package: @surfy/db
Description: Work with MongoDB and MySQL through the simple connector.
Author: Alexander Yermolenko
Latest version: 1.0.0

# DB
Work with MongoDB and MySQL through the simple connector.

## Installation
```
npm i @hqdaemon/db
```

## Usage
```js
let hqDB = require("@hqdaemon/db");
let options = {};
let db = await hqDB(options);
```

## Options
Field | Type | Value
-- | -- | --
type | string | "mongo" or "mysql"
database | string | "DB_NAME"
host | string | default "localhost"
port | int  | MongoDB default 27017, MySQL not use
connectionLimit | int | MongoDB not use, MySQL default 5
user | string | default ""
password | string | default ""

<br/>
<br/>

# Mongo
```js
let options = {
	type: "mongo"
};

let mongodb = await hqDB(options);
/*

Object {
	server: MongoServer,
	client: MongoClient,
	ObjectID: mongodb.ObjectID,
	DBRef: mongodb.DBRef,
	Double: mongodb.Double,
	Int32: mongodb.Int32,
	Long: mongodb.Long,
	BSONRegExp: mongodb.BSONRegExp,
	Decimal128: mongodb.Decimal128
}

*/
```

### Base methods
See full documentation on [MongoDB](https://www.npmjs.com/package/mongodb)
```js
let mongo = mongodb.client;
let db = await mongo.db("DB_NAME");
let collection = await db.collection("COLLECTION_NAME");
let resultOn = await collection.findOne({});
let result = await collection.find({});
mongo.close();
```

<br/>
<br/>

# MySQL
Connection pools help reduce the time spent connecting to the MySQL server by reusing a previous connection, leaving them open instead of closing when you are done with them.

See full documentation on [MySQL2](https://www.npmjs.com/package/mysql2)

```js
let mysql = await hqDB({
	type: "mysql",
	database: "DB_NAME",
	user: "USER_NAME",
	password: "PASSWORD",
	connectionLimit: 2
});
```

### Return
```js
{
	"type": "mysql",
	"database": "DB_NAME",
	"user": "USER_NAME",
	"connectionLimit": 2,
	"pool": Pool
}
```

### Base methods
```js
let result = await mysql.query("YOUR_QUERY",[]); // Sync
mysql.query("YOUR_QUERY", [], function(err,result){}); // Async
mysql.pool.end();
```


<br />
<br />
<br />
<br />

## MIT License

Copyright (c) HQ • [hqmode.com](https://hqmode.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
npm package: @surfy/geoip
Description: Best Free Rest API for IP-based user location detection
Author: Alexander Yermolenko
Latest version: 1.0.3

# GEO IP
### Best Free Rest API for IP-based user location detection.

**97.5%** IPv4 and IPv6 address coverage in our database with daily updates. Median data retrieval from the DB is **0.002 seconds**.


More info and an absolutely free API Key: https://surfy.one/geoip

## Installation

```
npm install @surfy/geoip
```

## Usage

```js

import GeoIP from "@surfy/geoip";

const geoIP = new GeoIP({
	email: "email@example.com",
	key: "YOUR_FREE_API_KEY" // Get a key > https://surfy.one/geoip
});

let testIPs = ["8.8.8.8", "2a01:e35:8bd9:8bb0:92b:8628:5ca5:5f2b"];

let results = [];
for(let IP of testIPs){
	let result = await geoIP.get(IP);
	result.push(result);
}

console.log(result);

/*

Result Object [
	{
		ip: '8.8.8.8',
		code: 'US',
		country: 'United States of America',
		region: 'California',
		city: 'Mountain View',
		latitude: 37.405992,
		longitude: -122.078515,
		zip: '94043',
		timezone: {
			id: "America/Los_Angeles",
			name: "Pacific Standard Time",
			gmt: "GMT-08:00","offset":-480,
			localTime: "11/12/2022, 10:02:08 AM GMT-08:00"
		},
		state: true
	},
	{
		ip: '2a01:e35:8bd9:8bb0:92b:8628:5ca5:5f2b',
		code: 'FR',
		country: 'France',
		region: 'Ile-de-France',
		city: 'Paris',
		latitude: 48.858365,
		longitude: 2.294532,
		zip: '75000',
		timezone: {
			id: "Europe/Paris",
			name: "Central European Standard Time",
			gmt: "GMT+01:00",
			offset: 60,
			localTime: "11/12/2022, 6:55:50 PM GMT+01:00"
		},
		state: true
	}
]

*/

```

<br />
<br />
<br />

## MIT License

Copyright (c) Alexander Yermolenko • [surfy.one](https://surfy.one)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
npm package: @surfy/jscompose
Description: Compose Your JavaScript Files Into One Bundle Including Required Files
Author: Alexander Yermolenko
Latest version: 1.0.0

# JSCompose
Compose Your JavaScript Files Into One Bundle Including Required or Imported Files

<br/>

## Installation
```
npm install @hqdaemon/jscompose
```

## Usage
Just add in the main JavaScript file other files with **require()** or **import** method.

In app.js (or other file)
```js
require("path_to_other_js_file/file.1.js");
import "path_to_other_js_file/file.2.js";
require("path_to_other_js_file/file.3");
```

...then compose it with **Node.js** and **jscompose**
```js
import jscompose from "@hqdaemon/jscompose";
let result = jscompose("/path_to_file/app.js");

// Return false or composed string
```

<br />
<br />
<br />
<br />

## MIT License

Copyright (c) Alexander Yermolenko • [surfy.one](https://surfy.one)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.