
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
ezobjects
Advanced tools
We're just getting started, check back later.
const ezobjects = require('ezobjects');
/** Create our customized object complete with constructor/init/getters/setters! */
ezobjects({
tableName: 'people',
className: 'Person',
fields: [
{ name: 'id', type: 'int', default: -1 },
{ name: 'firstName', type: 'string' },
{ name: 'lastName', type: 'string' },
{ name: 'checkingBalance', type: 'float' },
{ name: 'permissions', type: 'Array' },
{ name: 'favoriteDay', type: 'Date' }
]
});
/** Example new object initialized to defaults */
const a = new Person();
console.log(a);
/** Example new object initialized using `data` object passed to constructor */
const b = new Person({
id: 1,
firstName: 'Rich',
lastName: 'Lowe',
checkingBalance: 4.87,
permissions: [1, 2, 3],
favoriteDay: new Date('01-01-2018')
});
console.log(b);
/** Example new object initialized to defaults, then loaded with data using setter methods */
const c = new Person();
c.id(2);
c.firstName('Bert');
c.lastName('Reynolds');
c.checkingBalance(91425518.32);
c.permissions([1, 4]);
c.favoriteDay(new Date('06-01-2017'));
console.log(c);
/** Example retrieving data from object using getter methods */
console.log(`ID: ${c.id()}`);
console.log(`First Name: ${c.firstName()}`);
console.log(`Last Name: ${c.lastName()}`);
console.log(`Checking Balance: $${c.checkingBalance()}`);
console.log(`Permissions: ${c.permissions().join(`, `)}`);
console.log(`Favorite Day: ${c.favoriteDay().toString()}`);
{ id: [Function],
firstName: [Function],
lastName: [Function],
checkingBalance: [Function],
permissions: [Function],
favoriteDay: [Function],
_id: -1,
_firstName: '',
_lastName: '',
_checkingBalance: 0,
_permissions: [],
_favoriteDay: null }
{ id: [Function],
firstName: [Function],
lastName: [Function],
checkingBalance: [Function],
permissions: [Function],
favoriteDay: [Function],
_id: 1,
_firstName: 'Rich',
_lastName: 'Lowe',
_checkingBalance: 4.87,
_permissions: [ 1, 2, 3 ],
_favoriteDay: 2018-01-01T06:00:00.000Z }
{ id: [Function],
firstName: [Function],
lastName: [Function],
checkingBalance: [Function],
permissions: [Function],
favoriteDay: [Function],
_id: 2,
_firstName: 'Bert',
_lastName: 'Reynolds',
_checkingBalance: 91425518.32,
_permissions: [ 1, 4 ],
_favoriteDay: 2017-06-01T05:00:00.000Z }
ID: 2
First Name: Bert
Last Name: Reynolds
Checking Balance: $91425518.32
Permissions: 1, 4
Favorite Day: Thu Jun 01 2017 00:00:00 GMT-0500 (CDT)
FAQs
Easy Auto-Generated Strictly-Typed JavaScript Class Objects
The npm package ezobjects receives a total of 10 weekly downloads. As such, ezobjects popularity was classified as not popular.
We found that ezobjects demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.