pklonjs1
v1.0.1
Published
Pickle file parser for JavaScript/TypeScript
Maintainers
Readme
pklonjs1
pklonjs1 is a simple and powerful Node.js package that allows you to easily load .pkl (pickle) files and make predictions directly in JavaScript/TypeScript.
It solves two major problems:
- Loading
.pkl(Pickle) files properly inside Node.js (without needing Python) - Making predictions (especially for Decision Tree models) natively in JS, without external dependencies
No more complicated Python bridges or server hacks — just load your ML models and predict directly inside your JavaScript app! 🚀
Installation
npm install pklonjs1or
yarn add pklonjs1Quick Example
import PickleHandler from 'pklonjs1';
async function main() {
const model = await PickleHandler.loadPickle('./models/decision_tree_model.pkl');
const inputData = [-1.12, -0.28, -2.13, 1.09];
const prediction = PickleHandler.predictDecisionTree(model, inputData);
console.log('Prediction:', prediction);
}
main();Example Output
Prediction: 0Why use pklonjs1?
- ✨ No Python needed — everything runs purely in Node.js!
- ✨ Direct Pickle parsing — load
.pklfiles easily. - ✨ Built-in Decision Tree prediction — instantly use your models.
- ✨ Works with TypeScript — full typings included.
- ✨ Fast and lightweight — minimal dependencies.
Supported Features
- [x] Load Pickle files (
.pkl) into JS objects - [x] Predict output using Decision Tree models
- [ ] (More model types coming soon!)
License
MIT
Made with ❤️ to make Machine Learning accessible in Node.js.
