Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@condor-labs/mysql
Advanced tools
Readme
This module provide and usefull helper to use the official mysql library.
See official documentation here.
The minimum supported version of Node.js is v8.
To use the library you just need to follow the following steps Install the library with npm
npm install @condor-labs/mysql
Import the library:
const mysql = require('@condor-labs/mysql')(settings);
settings
object propertiesProperty | Default | Description |
---|---|---|
host (String) | 127.0.0.1 | The hostname of the database you are connecting to. |
port (Number) | 3306 | The port number to connect to. |
user (String) | The MySQL user to authenticate as. | |
password (String) | The password of that MySQL user. | |
Database (String) | Name of the database to use for this connection (optional ) |
constants.js
module.exports = {
settings: {
host: "127.0.0.1",
port: 3306,
user: "user",
password: "pass",
database: "my_database"
}
};
index.js
const {
settings
} = require('./constants');
try {
(async () => {
// init mysql connection
const mysql = require('@condor-labs/mysql')(settings);
// prepare query statement
let query = `select * from information_schema.tables where (?)=(?) limit 1`;
let params = [1, 1];
// Execute query
let res = await mysql.query(query, params);
// validate response
console.log(res && res.length > 0 ? 'MYSQL: Testing OK!!!' : 'MYSQL: Something went wrong, please check :( ');
// close app
process.exit(1);
})();
} catch (error) {
console.error(error)
}
You will need to update the package.json
file placed in the root folder.
identify the property version
and increase the right number in plus one.
npm login
[Enter username]
[Enter password]
[Enter email]
If all is ok the console will show you something like this : Logged in as USERNAME on https://registry.npmjs.org/.
npm publish --access public
Ref: https://docs.npmjs.com/getting-started/publishing-npm-packages
Note: you will need to have a NPM account, if you don't have one create one here: https://www.npmjs.com/signup
The original author and current lead maintainer of this module is the @condor-labs development team.
More about Condorlabs Here.
FAQs
This module provide and usefull helper to use the official mysql library.
The npm package @condor-labs/mysql receives a total of 543 weekly downloads. As such, @condor-labs/mysql popularity was classified as not popular.
We found that @condor-labs/mysql demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.