Skip to content

Commit

Permalink
add encode feature
Browse files Browse the repository at this point in the history
  • Loading branch information
lagden committed Sep 1, 2023
1 parent 7ce06cb commit 6a036c2
Show file tree
Hide file tree
Showing 9 changed files with 876 additions and 150 deletions.
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,3 @@ indent_style = space

[*.{md,yml,yaml}]
trim_trailing_whitespace = false

[.registry-*]
insert_final_newline = false
63 changes: 63 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
root: true
env:
es2022: true
node: true
parserOptions:
ecmaVersion: 13
sourceType: module
extends:
- eslint:recommended
- plugin:sonarjs/recommended
- plugin:unicorn/recommended
rules:
camelcase: off
capitalized-comments: off
indent: [error, tab]
linebreak-style: [error, unix]
no-console: off
no-debugger: off
# no-multi-assign: off
# no-multiple-empty-lines:
# - error
# -
# max: 2
# maxBOF: 2
# maxEOF: 0
# no-new-func: off
no-undef-init: off
no-unused-expressions:
- error
-
allowShortCircuit: true
allowTernary: true
allowTaggedTemplates: true
padding-line-between-statements: off
quotes: [error, single]
# require-atomic-updates: off
semi: [error, never]
semi-spacing:
- error
-
before: false
after: true
spaced-comment: off
# unicorn/consistent-destructuring: off
unicorn/filename-case: off
# unicorn/import-style:
# - error
# -
# styles:
# util: false
# path:
# named: true
# unicorn/no-abusive-eslint-disable: off
unicorn/no-array-reduce: off
# unicorn/no-negated-condition: off
# unicorn/no-null: off
unicorn/no-useless-undefined: off
unicorn/no-zero-fractions: off
# unicorn/prefer-dom-node-dataset: off
unicorn/prefer-includes: off
# unicorn/prefer-object-from-entries: off
unicorn/prefer-query-selector: off
unicorn/prevent-abbreviations: off
62 changes: 5 additions & 57 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,62 +1,10 @@
# Docs
doc
.ghtoken
# node
node_modules

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
*.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
# Coverage
coverage/**
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,30 @@

Make pooling connections with [MySQL](https://github.com/mysqljs/mysql#pooling-connections)


## Install

```
$ npm i -S @tadashi/mysql-pool
```


## Environment variable

Variable | Type | Required | Default | Description
-------- | --------| -----------| --------------| ------------
MYHOST | string | no | localhost | Hostname or server address
MYPORT | number | no | 3306 | Port number for the connection
MYUSER | string | no | root | User authentication
MYPASS | string | no | | Authentication password
MYLIMIT | number | no | 5 | Limit or threshold value
MYCONNECTTIMEOUT | number | no | 30000 | Connection timeout in milliseconds
MYACQUIRETIMEOUT | number | no | 30000 | Resource acquisition timeout in milliseconds
MYMULTIPLE | boolean | no | true | Allowing multiple statements
MYWAITFORCONNECTIONS | boolean | no | true | Waiting for available connections
MYENCODE | number | no | 0 | MYUSER and MYPASS encoded in base64


## Usage

```js
Expand Down
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tadashi/mysql-pool",
"version": "2.2.2",
"version": "2.3.0",
"description": "MySQL Pooling connections",
"type": "module",
"main": "src/mysql-pool.js",
Expand All @@ -13,7 +13,9 @@
"docker:rm": "docker kill mysql-pool-test; docker rm mysql-pool-test",
"_predocker": "npm run docker:rm",
"docker": "docker run -p 3306:3306 --name mysql-pool-test -e MYSQL_ROOT_PASSWORD=root -d mysql:latest",
"test": "c8 --reporter=text --reporter=text-summary --reporter=lcov ava --serial"
"eslint": "eslint --ignore-path .gitignore .",
"pretest": "npm run eslint",
"test": "c8 --reporter=text --reporter=text-summary --reporter=lcovonly --reporter=cobertura ava --tap --serial -T 30s"
},
"repository": {
"type": "git",
Expand All @@ -36,6 +38,9 @@
},
"devDependencies": {
"ava": "5.3.1",
"c8": "8.0.0"
"c8": "8.0.1",
"eslint": "8.48.0",
"eslint-plugin-sonarjs": "0.21.0",
"eslint-plugin-unicorn": "48.0.1"
}
}
Loading

0 comments on commit 6a036c2

Please sign in to comment.