{"id":16295,"library":"ark-database","title":"ARK Database Wrapper","description":"ark-database is a wrapper library designed for database access, specifically tailored for the `locator-kn/ark` application server. As of version 18.3.0, the package is deeply integrated into the `ark` ecosystem and requires `hapi` (>=9.x.x) as a peer dependency. The project appears to be abandoned, with its last commit in October 2017, and an open GitHub issue (dating back to 2016) indicates an unfinished transition from callback-based APIs to Promises. This leads to an inconsistent API surface where developers might encounter a mix of both patterns, necessitating direct source code inspection for clarity. Given its abandonment and tight coupling to an unmaintained server framework, it is not recommended for new projects. Its release cadence was irregular, with significant periods of inactivity.","status":"abandoned","version":"18.3.0","language":"javascript","source_language":"en","source_url":"git://github.com/locator-kn/ark-database","tags":["javascript"],"install":[{"cmd":"npm install ark-database","lang":"bash","label":"npm"},{"cmd":"yarn add ark-database","lang":"bash","label":"yarn"},{"cmd":"pnpm add ark-database","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required peer dependency for integration with the Hapi framework, on which the ark server ecosystem is built.","package":"hapi","optional":false}],"imports":[{"note":"This package primarily uses CommonJS `require` syntax. Given its last update in 2017, it does not officially support ES Modules.","symbol":"Database","correct":"const Database = require('ark-database');"}],"quickstart":{"code":"const Database = require('ark-database');\n\n// Initialize the database wrapper for a specific tenant/user context\nconst db = new Database('alice'); \n\n// Example: Get a user by ID using a callback\ndb.getUserById('1234567890', function(err, res) {\n   if (err) {\n      console.error('Error fetching user:', err);\n      return;\n   }\n   console.log('User found:', res);\n});\n\n// Example: Create a new trip entry\nconst newTrip = { \n  id: 'trip-abc-123',\n  userId: 'alice',\n  destination: 'Wonderland',\n  startDate: new Date(),\n  status: 'planned'\n};\ndb.createTrip(newTrip, function(err, res) {\n   if (err) {\n      console.error('Error creating trip:', err);\n      return;\n   }\n   console.log('Trip created:', res);\n});\n\n// Example: Delete a location by ID\ndb.deleteLocationById('12322456576567', function(err, res) {\n   if (err) {\n      console.error('Error deleting location:', err);\n      return;\n   }\n   console.log('Location deleted result:', res);\n});","lang":"javascript","description":"This quickstart demonstrates the core usage of `ark-database` including initialization and performing basic CRUD operations (get, create, delete) using its callback-based API."},"warnings":[{"fix":"Migrate to a currently maintained database abstraction layer or ORM. This package is unsuitable for new development or production environments.","message":"The `ark-database` package and its core dependency, `locator-kn/ark`, have been abandoned since late 2017. There will be no further updates, bug fixes, or security patches.","severity":"breaking","affected_versions":">=18.3.0"},{"fix":"Always check the source code for the specific method's signature or assume a callback API. Wrap callback-based methods in Promises manually if Promise-based usage is desired (e.g., using `util.promisify`).","message":"The API is inconsistent, with some methods using traditional Node.js callbacks while others might have been partially refactored to return Promises (as indicated by a long-standing open GitHub issue). This requires careful inspection of the source code for each method used.","severity":"gotcha","affected_versions":">=18.0.0"},{"fix":"Ensure your project explicitly installs a compatible Hapi version. However, given Hapi's evolution and this package's abandonment, finding a compatible and secure Hapi version for modern Node.js may be challenging.","message":"The package has a strict `hapi` peer dependency ('>=9.x.x'). Running this package with newer or significantly older versions of Hapi, or with non-Hapi environments, will likely result in installation failures or runtime errors.","severity":"breaking","affected_versions":">=18.0.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Run `npm install ark-database` to add it to your project's dependencies.","cause":"The package `ark-database` is not installed or incorrectly referenced in your project.","error":"Error: Cannot find module 'ark-database'"},{"fix":"Install a compatible version of Hapi: `npm install hapi@^9.0.0`. Note that Hapi v9 is very old and potentially insecure for modern applications.","cause":"The `hapi` peer dependency requirement for `ark-database` is not met in your project.","error":"npm WARN ark-database@18.3.0 requires a peer of hapi@>=9.x.x but none is installed."},{"fix":"Verify the exact method name and its expected arguments (callback or Promise return) by consulting the library's source code, as documentation may be incomplete or outdated.","cause":"Attempting to call a database method that does not exist or has an unexpected signature (e.g., expecting a Promise when it's callback-based).","error":"TypeError: db.someMethod is not a function"}],"ecosystem":"npm"}