Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@jaysalvat/smart-model
Advanced tools
Javascript object model.
Install npm package
npm install @jaysalvat/smart-model
import SmartModel from '@jaysalvat/smart-model'
<script src="https://unpkg.com/@jaysalvat/smart-model@latest/build/smart-model.umd.min.js"></script>
Better documentation soon...
const Post = SmartModel.create('Post', {
title: {
required: true,
type: String,
},
body: {
required: true,
type: String,
},
createdAt: {
type: Date,
default: new Date(),
transform: (value) => new Date(value),
format: (value) => new Date().toLocaleString()
},
updatedAt: {
type: Date,
default: new Date(),
transform: (value) => new Date(value),
format: (value) => new Date().toLocaleString()
},
bodyLength: (post) => post.body.length,
}, {
onUpdate() {
this.updateAt = new Date()
}
})
const post = new Post({
title: 'my new post',
body: 'lorem ipsum...'
})
Dev mode
npm run dev
Build
npm run build
Lint
npm run lint
Fix lint errors
npm run lint:fix
Bump version and publish to NPM
npm run release
npm run release:patch
npm run release:minor
npm run release:major
FAQs
SmartModel is a fun experiment over Javascript Proxy. It tends to bring useful tools and best practices to data objects.
The npm package @jaysalvat/smart-model receives a total of 3 weekly downloads. As such, @jaysalvat/smart-model popularity was classified as not popular.
We found that @jaysalvat/smart-model demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.