{"id":22537998,"url":"https://github.com/colored-coins/fs-sort","last_synced_at":"2025-03-28T06:42:52.896Z","repository":{"id":33584126,"uuid":"37230541","full_name":"Colored-Coins/fs-sort","owner":"Colored-Coins","description":"Node module that recursivly finds all files in path and create a list of all of those files orderded by the filter function provided","archived":false,"fork":false,"pushed_at":"2015-06-11T00:44:43.000Z","size":104,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-06T21:42:28.708Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Colored-Coins.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-11T00:42:43.000Z","updated_at":"2019-01-13T14:01:05.000Z","dependencies_parsed_at":"2022-09-08T01:12:03.927Z","dependency_job_id":null,"html_url":"https://github.com/Colored-Coins/fs-sort","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Colored-Coins%2Ffs-sort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Colored-Coins%2Ffs-sort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Colored-Coins%2Ffs-sort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Colored-Coins%2Ffs-sort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Colored-Coins","download_url":"https://codeload.github.com/Colored-Coins/fs-sort/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245984558,"owners_count":20704794,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-07T11:09:40.271Z","updated_at":"2025-03-28T06:42:52.875Z","avatar_url":"https://github.com/Colored-Coins.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fs-sort\n[![Build Status](https://travis-ci.org/Colored-Coins/fs-sort.svg?branch=master)](https://travis-ci.org/Colored-Coins/fs-sort) [![Coverage Status](https://coveralls.io/repos/Colored-Coins/fs-sort/badge.svg?branch=master)](https://coveralls.io/r/Colored-Coins/fs-sort?branch=master) [![npm version](https://badge.fury.io/js/fs-sort.svg)](http://badge.fury.io/js/fs-sort)\n\nfs-sort recursivly finds all files in path and create a list of all of those files orderded by the filter function provided\n\n### Installation\n\n```sh\n$ npm i fs-sort\n```\n\n\n### Get sorted files\n\nParams:\n\n  - path - Path to get files from\n  - ignores - Array of file names to ignore\n  - sortingFunction - The function that \"chooses\" what file property to use for sorting. sortingFunction receive the parameter fileObject which is in the form of:\n\n```js\n{\n  fileName: \"Name of the file, including the extension\",\n  fileStats: \"File stats that dependes on the version of node you are running and the OS\",\n  fileFullPath: \"Full file path to system root folder\"\n}\n```\n\n  - callback - A callback in the form of function(err, orderedFileList)\n\n##### Example:\n\n```js\nvar fs_sort = require('fs-sort')\n\nvar sortingFunction = function (fileObject) {\n  return fileObject.fileName\n}\n\nfs_sort('/data', [], sortingFunction, function (err, list) {\n  if (err) throw err\n  for (var file in list) {\n    console.log(list[file])\n    // Will print something like this:\n    // {\n    //  fileName: '8.tmp',\n    //  fileStats:\n    //  {\n    //    dev: 16777220,\n    //    mode: 33188,\n    //    nlink: 1,\n    //    uid: 502,\n    //    gid: 20,\n    //    rdev: 0,\n    //    blksize: 4096,\n    //    ino: 21894243,\n    //    size: 8230522,\n    //    blocks: 16080,\n    //    atime: Thu Jun 11 2015 03:27:26 GMT+0300 (IDT),\n    //    mtime: Thu Jun 11 2015 03:27:26 GMT+0300 (IDT),\n    //    ctime: Thu Jun 11 2015 03:27:26 GMT+0300 (IDT)\n    //   },\n    //   fileFullPath: '/Users/username/folder/data/8.tmp',\n    //   mainAttribute: '8.tmp'\n    // }\n  }\n})\n```\n\n\n### Testing\n\nIn order to test you need to install [mocha] globaly on your machine\n\n```sh\n$ cd /\"module-path\"/fs-sort\n$ mocha\n```\n\n\nLicense\n----\n\nMIT\n\n[mocha]:https://www.npmjs.com/package/mocha","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolored-coins%2Ffs-sort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolored-coins%2Ffs-sort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolored-coins%2Ffs-sort/lists"}