Package Exports
- quartz-quartile-cruncher
- quartz-quartile-cruncher/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (quartz-quartile-cruncher) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
quartz-quartile-cruncher
A lightweight Node.js utility to analyze arrays of numbers using statistical quartiles.
✨ Features
- Calculate quartile boundaries: Q1 (25th percentile), Q2 (median), Q3 (75th percentile)
- Divide data into 4 sorted quarters (Q1–Q4)
- Includes helper functions:
min,max, andaverage
📦 Installation
npm install quartz-quartile-cruncher🚀 Usage
const stats = require('quartz-quartile-cruncher');
const numbers = [10, 20, 30, 40, 50, 60, 70, 80];
// Quartile Boundaries
console.log(stats.quartileBoundaries(numbers));
// => { Q1: 27.5, Q2: 45, Q3: 62.5 }
// Value-based Quartile Groups
console.log(stats.quarterly(numbers));
/*
[
{ quarter: 1, count: 2, values: [10, 20] },
{ quarter: 2, count: 2, values: [30, 40] },
{ quarter: 3, count: 2, values: [50, 60] },
{ quarter: 4, count: 2, values: [70, 80] }
]
*/
// Basic stats
console.log(stats.min(numbers)); // 10
console.log(stats.max(numbers)); // 80
console.log(stats.average(numbers)); // 45📚 API Reference
quartileBoundaries(array) ⇒ { Q1, Q2, Q3 }
Returns the 25th, 50th, and 75th percentile of the sorted array.
quarterly(array) ⇒ Array
Returns an array of four objects { quarter, count, values[] } after sorting.
min(array), max(array), average(array)
Basic statistical helpers.
📄 License
MIT License
© 2025 Dapid Candra