![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
orientdb-rest-api
Advanced tools
A node.js driver for OrientDB using the OrientDB RESTful HTTP protocol
A Node.js driver to talk to the OrientDB REST API
Very basic http wrapper using axios based on node-orient-http and tested on OrientDb 2.2.31
npm install orientdb-rest-api
const OrientDB=require('orientdb-rest-api');
const db = new OrientDB({
user: 'root',
password: 'root_passwd',
host: 'http://localhost:2480',
database: 'GratefulDeadConcerts',
})
db.connect().then(async ()=>{
const result=await db.query('select * from V where name = ?',["Batman"])
console.log(result)
}).catch(err=>{
console.error(err.message)
})
db.command('insert into V set name = ?', ["Batman"]).then(async ()=>{
// named parameters
const queryResult=await db.query('select * from V where name = :name', null, null, {
name: "Batman"
})
console.log(queryResult)
}).catch((err)=>console.error(err))
// general api
db.[get|post|put|delete](command, queryParams, postBody).then(successHandler).catch(errorHandler)
db.post('document', null, { '@class': 'V', name: 'Gustavo Salome'}).then(successHandler).catch(errorHandler)
db.delete('document', '9:1').then(successHandler).catch(errorHandler)
// or specific commands
db.command('insert into V set name = "Batman"').then(successHandler).catch(errorHandler)
db.query('select * from V where name = "Batman"').then((res)=>{
console.log(res)
}).catch(err=>{
console.log(err.message)
})
db.language('gremlin').query("g.V('@class', 'User')").then(successHandler2).catch(errorHandler2)
const db = new OrientDB({
user: 'root',
password: 'root_passwd',
host: 'http://localhost:2480',
database: 'GratefulDeadConcerts',
})
db.connect()
// once connected
db.once('connected', (db)=>{
console.log('yes! connected')
})
// on error
db.on('error',err=>{
console.log('err', err.message)
})
const OrientDB=require ('orientdb-rest-api')
const db=new OrientDB({
user: 'root',
password: 'password',
host: 'http://localhost:2480',
database: 'GratefulDeadConcerts',
})
db.connect().then(async ()=>{
let res
res=await db.command('insert into V set name = ?', ["Batman"])
console.log(res)
res=await db.query('select * from V where name = :name', {
name: "Batman"
})
console.log(res)
res=await db.command('select * from V where name = ?', ["Batman"], 1)
console.log(res)
res=await db.delete('document', res.result[0]['@rid'])
console.log(res.status)
}).catch(err=>{
if(!err)
console.error('err')
else if(err.response && err.response.data)
console.error(err.response.data)
else if(err.message)
console.error(err.message)
else
console.error(err)
})
See OrientDB-REST API for more docs.
Listening for error events
db.on('error',err=>{
console.log('err', err)
})
See Axios Error Handling for more information
1.0.0
FAQs
A node.js driver for OrientDB using the OrientDB RESTful HTTP protocol
The npm package orientdb-rest-api receives a total of 1 weekly downloads. As such, orientdb-rest-api popularity was classified as not popular.
We found that orientdb-rest-api 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
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.