{"library":"sparkline","title":"sparkline","type":"library","description":"sparkline is a JavaScript library that generates textual sparklines (small, intense, word-sized graphics) inspired by Holman's 'spark' utility. It takes an array of numerical data and outputs a compact string representation of a line graph, primarily for console or plain text display. The current stable version, 0.2.0, was last released on June 23, 2017. Given the lack of updates since then, its development is considered abandoned. It differentiates itself by producing character-based sparklines suitable for terminal output or simple HTML, in contrast to modern SVG/Canvas-based solutions, and predates the common adoption of ES Modules (ESM) and TypeScript in the JavaScript ecosystem.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install sparkline"],"cli":null},"imports":["const sparkline = require('sparkline');","sparkline([1, 5, 22, 7, 9]);"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/shiwano/sparkline","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/sparkline","openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"const sparkline = require('sparkline');\n\n// Generate a sparkline from an array of numbers\nconst data = [1, 5, 22, 7, 9, 15, 3, 18, 10, 25];\nconst line = sparkline(data);\nconsole.log('Node.js Console Sparkline:', line);\n\n// Example with more data points and options (inferred from v0.2.0 release notes)\n// The README only shows basic usage, but 'html' option was added in v0.2.0\n// For basic console output, the array is sufficient.\nconst largerData = Array.from({ length: 20 }, (_, i) => Math.sin(i / 2) * 10 + 10 + Math.random() * 5);\nconst anotherLine = sparkline(largerData);\nconsole.log('Another Sparkline:', anotherLine);\n\n// To run as a command-line utility:\n// npm install -g sparkline\n// sparkline 12 43 56 30 15\n// echo 21,45,6,25,19,15 | sparkline","lang":"javascript","description":"Demonstrates basic CommonJS usage in Node.js to generate a textual sparkline from an array of numbers.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}