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.
harperive
Advanced tools
Readme
A NodeJs Client for HarperDB
HarperDB is a SQL/NoSQL data management platform. It is fully indexed, doesn't duplicate data, and runs on any device- from the edge to the cloud.
It is built natively as a set of micro-services, making development and integration easy and seamless. HarperDB utilizes a single-endpoint for all operations. HarperDB’s RESTful nature makes it stateless, stable, and scalable.
Harperive is a node.js driver for HarperDb.
It is written in JavaScript, it natively supports promises and functions can be executed with callbacks. Each HarperDb operation is exposed as a function on the client object. All functions take query options and an optional callback function.
See the official documentation website here
Follow the instructions on the HarperDB get started page for installation and get HarperDB up and running.
Harperive is available as an npm package.
# installs the package for your project
npm install harperive --save
You need to create a DB Client with following parameters passing the appropriate values and then you can perform any db operation.
harperHost
- host name of the harperdb server, example: https://harper-test-dev.harperdbcloud.com
username
- username of your db userpassword
- password of the usertoken (optional)
- jwt authentication token, pass either username/password or token for authorised database operation.schema (optional)
- schema name, if not passed while creating client then need to be passed while calling operations. (Passing schema lets you perform CRUD operations on that schema)const harperive = require('harperive');
const DB_CONFIG = {
harperHost: process.env.DB_HOST,
username: process.env.DB_USER,
password: process.env.DB_PASS,
token: process.env.OPERATION_TOKEN, // pass either username/password or token
schema: process.env.SCHEMA, // optional params
/* Alternatively schema can be passed in the options while quering for any operations on specific schema.
* Refer bewlow on how to execute operation for more clarification.
*/
}
const Client = harperive.Client;
const client = new Client(DB_CONFIG);
// function call with callback
client.dbOperation(options, (err, res) => {
if(err) console.log(err);
else console.log(res);
});
// function call expecting promise
client.dbOperation(options)
.then(res => console.log(res))
.catch(err => console.log(err));
// function call as async/await expecting promise
async function executeQuery() {
try {
const res = await client.dbOperation(options)
console.log(res);
} catch(err) {
console.log(err);
}
}
executeQuery();
// success response (recieved in 2nd arg of the callback / resolved when called as promise)
{
statusCode: 200,
status: 'SUCCESS',
operation: 'search_by_value',
data:
[
{
__createdtime__: 1591894774234,
__updatedtime__: 1591894774234,
country: 'BELGIUM',
date: '1810-05-13',
id: 15,
image: '',
name: 'BELGIAN SHEPHERD DOG',
section: 'Sheepdogs'
}
]
}
// failure(error) response (recieved in 1st arg of the callback / rejected when called as promise)
{
error: 'unknown attribute \'address\'',
statusCode: 500,
status: 'FAILED',
operation: 'search_by_value'
}
Copyright (c) 2020 Chandan Kumar
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.
FAQs
A Node.Js client to connect HarperDB local or cloud simplifying api request
The npm package harperive receives a total of 5 weekly downloads. As such, harperive popularity was classified as not popular.
We found that harperive 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
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.