Socket
Socket
Sign inDemoInstall

arango-tools

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arango-tools

tools for working with ArangoDB


Version published
Weekly downloads
93
increased by17.72%
Maintainers
1
Weekly downloads
 
Created
Source

ArangoTools

ArangoJS describes itself as "The official ArangoDB low-level JavaScript client". The "low-level" part never really meant much to me in my inital usage. Over time I've been finding patterns in my own usage and accumulated workarounds, which I kept telling myself I would extract into a library. This is that library.

Usage

The makeDatabase call returns a set of functions that allow you to query, truncate and drop the database you just created.

Databases and collections that are asked for via makeDatabase will be created if they don't already exist.

let { makeDatabase } = await ArangoTools({ rootPass, url })

let {query, truncate, drop, collections} = await makeDatabase({
  dbname: 'foo',
  user,
  password,
  documentCollections: ['widgets'],
})

await collections.widgets.save({foo: "bar"})

let cursor = await query`
FOR widget IN widgets
  FILTER widget.foo === "bar"
  RETURN widget
`

await cursor.all()
// [{foo: "bar"}]

await drop()

Arango-tools also provides a helper function that generates a database name from the current file which is helpful for tests:

var response = await makeDatabase({
	dbname: dbNameFromFile(__filename),
	user: 'mike',
	password: 'secret',
	documentCollections: ['foos'],
})

Issues

This library is very focused on smoothing out the process of using Arango as a document store in a TDD workflow. Much of the other functionality of Arango will still require ArangoJS to access. TODO:

  • A way to create indexes
  • Should this be running migrations a-la arangomigo?

FAQs

Package last updated on 12 Apr 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc