{"library":"array-timsort","type":"library","category":null,"description":"The `array-timsort` package provides a JavaScript implementation of Python's highly optimized Timsort algorithm for stable array sorting. It is currently at version 1.0.3, with an apparent maintenance-only release cadence based on its last commit over two years ago. Unlike the `timsort` package it was forked from, `array-timsort` returns an array representing the original indices of elements after sorting, rather than `undefined`. Timsort is an adaptive, stable sorting algorithm that leverages existing order in data, achieving O(n) performance on partially sorted arrays and O(n log n) worst-case time complexity, with O(n) memory usage. Benchmarks suggest it can significantly outperform `Array.prototype.sort()` in Node.js for specific data distributions, such as descending arrays or those with many duplicates, while potentially being slower on certain random distributions.","language":"javascript","status":"maintenance","version":"1.0.3","tags":["javascript","fast sort","array soft","sort","compare","TimSort","algorithm","python","performance"],"last_verified":"Wed May 27","install":[{"cmd":"npm install array-timsort","imports":["const { sort } = require('array-timsort')","const timsortModule = require('array-timsort');\ntimsortModule.sort(array);","const { sort } = require('array-timsort')"]},{"cmd":"yarn add array-timsort","imports":[]},{"cmd":"pnpm add array-timsort","imports":[]}],"homepage":null,"github":"https://github.com/kaelzhang/node-array-timsort","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/array-timsort","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/array-timsort/compatibility"}}