Registry / storage / node-active-resource

node-active-resource

JSON →
library1.4.8jsnpmunverified

Node-Active-Resource is a primitive ORM that maps RESTful API resources to JavaScript objects in Node.js, inspired by HER. Current version 1.4.8, with no recent updates or fixed release cadence. It requires Node >=0.8.0 and is open for contributions but appears largely unmaintained. Provides `Resource.define_resource` for defining REST resources and a `vger` function for configuration.

npm install node-active-resource
INSTALL
IMPORT
SIG · NODE-ACTIVE-RESOUR
N
node-active-resource
storagejavascriptv1.4.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Resource
import { Resource } from 'node-active-resource'
const Resource = require('node-active-resource').Resource
ESM is supported, but CJS require also works.
vger
import vger from 'node-active-resource'
const vger = require('node-active-resource')()
Default export is a function, not an object. Use default import.
define_resource
import { Resource } from 'node-active-resource'; Resource.define_resource({...})
import { define_resource } from 'node-active-resource'
`define_resource` is a method on the `Resource` object, not a named export.

Configures a vger client and defines a User resource mapped to /users, then fetches user 1.

import vger from 'node-active-resource'; const service = vger({ host: 'api.example.com', port: 443 }); import { Resource } from 'node-active-resource'; const User = Resource.define_resource({ collectionPath: '/users' }); async function main() { const user = await User.find(1); console.log('User:', user); } main().catch(console.error);
Debug
Known issues
deprecatedThis package is no longer maintained and may have security vulnerabilities.
fix
Consider migrating to a modern ORM like Prisma or a REST client like Axios.
affects: >=0.0.0
gotchaThe default export is a function, not an object. Doing `const vger = require('node-active-resource')()` is correct for CommonJS, not `const vger = require('node-active-resource')`.
fix
Use `import vger from 'node-active-resource'` or `const vger = require('node-active-resource')()`.
affects: >=0.0.0
gotcha`Resource.define_resource` expects an object with `collectionPath`, not a string.
fix
Pass an object: `Resource.define_resource({ collectionPath: '/users' })`.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'node-active-resource'
Package not installed or missing from node_modules.
fix
Run `npm install node-active-resource` and ensure it's listed in package.json.
TypeError: vger is not a function
Using default import incorrectly (e.g., `import { vger }` instead of default import).
fix
Use `import vger from 'node-active-resource'` or `const vger = require('node-active-resource')()`.
TypeError: Resource.define_resource is not a function
`define_resource` is not a named export; it's a method on Resource.
fix
Import Resource as `import { Resource } from 'node-active-resource'` then call `Resource.define_resource(...)`.
Upgrade
Version history
1.4.8latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
14
Amazon
1
Resources
node-active-resource — npm install node-active-resource · libregistry