
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
GrainJS is a Javascript (and TypeScript) library for building highly performant dynamic applications.
GrainJS provides convenient pure-JS interfaces for building DOM. It has observables inspired by Knockout to create declarative data models and tie them to UI. It includes light-weight event dispatching, DOM event subscriptions, disposable components, and in-code CSS styling.
GrainJS is in part inspired by React, but based on observables instead of virtual dom, and with a convenient way to build DOM without JSX. It is lighter weight, and has less magic happening under the covers.
The focus is on performance and conciseness. The library has no dependencies and is only 31K. minified.
npm install --save grainjs
const name = observable("");
dom.update(document.body,
dom('input', {type: 'text', placeholder: 'Enter your name'},
dom.on('input', (ev, elem) => name.set(elem.value)),
),
dom('div', 'Hello, ',
dom.text((use) => use(name).toUpperCase() || 'Stranger'),
'!',
),
);
At a basic level, GrainJS allows you to describe DOM structure in one place, using Javascript (or TypeScript), and to keep the dynamic aspects of it separated into variables called "observables". These observables serve as the model of the UI; other code can update them to cause UI to update, without knowing the details of the DOM construction.
In addition, the library provides approaches to create and dispose resources (important for long-lived single-page applications), and an assortment of other related tools.
FAQs
JS library from Grist Labs
The npm package grainjs receives a total of 635 weekly downloads. As such, grainjs popularity was classified as not popular.
We found that grainjs 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
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.