Gathering detailed insights and metrics for @studiometa/js-toolkit
Gathering detailed insights and metrics for @studiometa/js-toolkit
Gathering detailed insights and metrics for @studiometa/js-toolkit
Gathering detailed insights and metrics for @studiometa/js-toolkit
🔧 A data-attributes driven JavaScript tiny framework
npm install @studiometa/js-toolkit
Typescript
Module System
Node Version
NPM Version
TypeScript (85.72%)
Twig (8.73%)
JavaScript (4.5%)
Vue (0.48%)
HTML (0.39%)
SCSS (0.17%)
Total Downloads
72,738
Last Day
142
Last Week
1,106
Last Month
8,514
Last Year
26,736
MIT License
32 Stars
2,524 Commits
3 Forks
15 Watchers
13 Branches
17 Contributors
Updated on Aug 30, 2025
Latest Version
3.1.1
Package Id
@studiometa/js-toolkit@3.1.1
Unpacked Size
580.65 kB
Size
141.73 kB
File Count
385
NPM Version
10.9.3
Node Version
22.18.0
Published on
Aug 29, 2025
Cumulative downloads
Total Downloads
Last Day
-21.5%
142
Compared to previous day
Last Week
-48.3%
1,106
Compared to previous week
Last Month
185.8%
8,514
Compared to previous month
Last Year
102.6%
26,736
Compared to previous year
2
A JavaScript data-attributes driven micro-framework shipped with plenty of useful utility functions to boost your project.
Install the latest version via NPM:
1npm install @studiometa/js-toolkit
This project is a JavaScript micro-framework (along with its utility functions) whose main objectives are:
Visit js-toolkit.studiometa.dev to learn more, jump directly to ui.studiometa.dev to discover existing components, or open the playground to test it live.
This framework lets you define components as classes, and bind them to the DOM with data-…
attributes. For example, here is how a Counter
component would be defined in JavaScript:
1import { Base } from '@studiometa/js-toolkit'; 2 3export default class Counter extends Base { 4 static config = { 5 name: 'Counter', 6 refs: ['add', 'remove', 'count'], 7 }; 8 9 get counter() { 10 return this.$refs.count.valueAsNumber; 11 } 12 13 set counter(value) { 14 this.$refs.count.value = value; 15 } 16 17 onAddClick() { 18 this.counter += 1; 19 } 20 21 onRemoveClick() { 22 this.counter -= 1; 23 } 24}
And its accompanying HTML would be sprinkled with data-…
attributes to bind elements from the DOM to the JavaScript class.
1<div data-component="Counter"> 2 <button data-ref="add">Add</button> 3 <button data-ref="remove">Remove</button> 4 <input data-ref="count" type="number" value="0" /> 5</div>
You can define options that can be specified with data-option-...
attributes as well. First in JavaScript:
1 class Counter extends Base { 2 static config = { 3 name: 'Counter', 4 refs: ['add', 'remove', 'count'], 5+ options: { 6+ step: { 7+ type: Number, 8+ default: 1, 9+ }, 10+ }, 11 }; 12 13 onAddClick() { 14- this.counter += 1; 15+ this.counter += this.$options.step; 16 } 17 18 onRemoveClick() { 19- this.counter -= 1; 20+ this.counter -= this.$options.step; 21 } 22 }
And then adjust it as you wish in your HTML:
1- <div data-component="Counter"> 2+ <div data-component="Counter" data-option-step="2"> 3 <button data-ref="add">Add</button> 4 <button data-ref="remove">Remove</button> 5 <input data-ref="count" type="number" value="0"> 6 </div>
The framework also offers a way to instantiate a root component as an application, with child components as dependencies:
1import { Base, createApp } from '@studiometa/js-toolkit'; 2import Counter from './components/Counter.js'; 3 4class App extends Base { 5 static config = { 6 name: 'App', 7 components: { 8 Counter, 9 }, 10 }; 11} 12 13export default createApp(App);
Visit our "Getting Started" guide to learn more and try the above component by visiting the playground. Discover our existing library of components by checking out the @studiometa/ui package.
This projects follows the Git Flow methodology to manage its branches and features. The packages and their dependencies are managed with NPM workspaces. The files are linted with ESLint, type checked with TypeScript and formatted with Prettier.
See LICENSE.
No vulnerabilities found.