Registry / database / snowstorm

snowstorm

JSON →
library1.0.0jsnpmunverified

A minimal JavaScript ORM for Node.js that maps plain data objects to model instances with typed properties. Version 1.0.0 provides property types (string, number, boolean, array, object, date, model) with custom property support, serialization via toJSON(), and prototype extension. It has low release activity and is suitable for simple data mapping use cases.

npm install snowstorm
INSTALL
IMPORT
SIG · SNOWSTORM
S
snowstorm
databasejavascriptv1.0.0
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.

default
✓ const snowstorm = require('snowstorm')
✗ import snowstorm from 'snowstorm'
snowstorm is CommonJS-only. ESM import is not supported.
snowstorm.create
✓ const Task = snowstorm.create('Task', { title: snowstorm.Properties.string })
✗ const Task = require('snowstorm').create('Task', ...)
Same as using main module; no named export.
snowstorm.Properties
✓ const { Properties } = require('snowstorm')
✗ import { Properties } from 'snowstorm'
Destructuring from CommonJS require works; ESM does not.

Defines a Task model with typed properties, instantiates from plain data, and demonstrates access and serialization.

const snowstorm = require('snowstorm'); const Task = snowstorm.create('Task', { title: snowstorm.Properties.string, completed: snowstorm.Properties.boolean, createdAt: snowstorm.Properties.date('created_at') }); Task.prototype.isCompleted = function () { return this.completed; }; const responseData = { title: 'Task out the trash', completed: false, created_at: '2015-08-20T10:00:00.000Z' }; const task = new Task(responseData); console.log(task.title); console.log(task.isCompleted()); console.log(task.toJSON());
Debug
Known issues
gotchasnowstorm is CommonJS-only; ESM import (import snowstorm from 'snowstorm') will fail.
fix
Use require('snowstorm') or configure bundler to handle CommonJS.
affects: >=1.0.0
gotchaNo type definitions; TypeScript users cannot rely on IDE intellisense.
fix
Write custom type declarations or consider an ORM with built-in TS support.
affects: >=1.0.0
gotchaPrototype methods are added after model creation; order matters.
fix
Define all prototype methods immediately after snowstorm.create() and before instantiation.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: snowstorm.create is not a function
Wrong import style (e.g., ESM import on CommonJS module).
fix
Use CommonJS require: const snowstorm = require('snowstorm');
TypeError: Cannot read property 'string' of undefined
snowstorm.Properties is undefined because module not loaded correctly.
fix
Ensure snowstorm is required via CommonJS and not as a default import.
ReferenceError: require is not defined
Running in ESM environment (e.g., type: 'module' in package.json).
fix
Use dynamic import or switch to CommonJS project; or find an ESM-compatible ORM.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
snowstorm — npm install snowstorm · libregistry