merge-sort-array
v1.0.5
Published
This is module for merge array sort.
Maintainers
Readme
This is module which can sort an array using merge sort algorithm.
Install.
You can install it from npm repository using next comand:
npm install merge-sort-array --save
This is example how to use this module.
http.createServer(function(request, response) {
var data = '';
request.on('data', function(chunk) {
data += chunk.toString();
});
request.on('end', function() {
var unsortArray = JSON.parse(data);
if (unsortArray.length) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.write(JSON.stringify(mergeSort(unsortArray)));
response.end();
}
});
}).listen(3000);
