{"id":19261664,"url":"https://github.com/alexbykoff/datafield","last_synced_at":"2025-04-21T17:30:53.272Z","repository":{"id":70096649,"uuid":"140161801","full_name":"alexbykoff/datafield","owner":"alexbykoff","description":"Sort, select, filter, evaluate and perform maths on your arrays of data","archived":false,"fork":false,"pushed_at":"2018-11-13T16:46:49.000Z","size":427,"stargazers_count":28,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-12T08:20:54.702Z","etag":null,"topics":["arrays","collections","data-analysis","data-structures","filtering","sorting"],"latest_commit_sha":null,"homepage":"https://tomkallen.github.io/datafield/","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/alexbykoff.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-08T11:29:33.000Z","updated_at":"2023-12-16T10:33:11.000Z","dependencies_parsed_at":"2023-03-11T07:57:11.742Z","dependency_job_id":null,"html_url":"https://github.com/alexbykoff/datafield","commit_stats":{"total_commits":104,"total_committers":2,"mean_commits":52.0,"dds":"0.038461538461538436","last_synced_commit":"43fe57d3daa5118b4566d2973d0d7c33030c8d6a"},"previous_names":["alexbykoff/datafield","tomkallen/datafield"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexbykoff%2Fdatafield","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexbykoff%2Fdatafield/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexbykoff%2Fdatafield/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexbykoff%2Fdatafield/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexbykoff","download_url":"https://codeload.github.com/alexbykoff/datafield/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250100258,"owners_count":21374904,"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":["arrays","collections","data-analysis","data-structures","filtering","sorting"],"created_at":"2024-11-09T19:27:55.585Z","updated_at":"2025-04-21T17:30:53.014Z","avatar_url":"https://github.com/alexbykoff.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://rawgit.com/tomkallen/datafield/master/docs/datafield.png\"\u003e\n\u003c/p\u003e\n\n\u003ch3 align=\"center\"\u003eSort, select, filter and perform maths and analysis on your arrays of data\u003c/h3\u003e\n\u003ch4 color=\"blue\" align=\"center\"\u003e:bear: version 0.3.0 is out\u003c/h4\u003e\n\n[![codecov](https://codecov.io/gh/tomkallen/datafield/branch/master/graph/badge.svg)](https://codecov.io/gh/tomkallen/datafield)\n[![Build Status](https://travis-ci.org/tomkallen/datafield.svg?branch=master)](https://travis-ci.org/tomkallen/datafield)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n[![npm version](https://badge.fury.io/js/datafield.svg)](https://badge.fury.io/js/datafield)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n\n[:page_facing_up: Read the documentation here](https://tomkallen.github.io/datafield/)  \n[:cat: Contribute for the greater good](https://github.com/tomkallen/datafield/blob/master/CONTRIBUTING.md)  \n\n## What is DataField\n\nDataField is a library that helps you wrangle your awesome collections of data you obtain from different sources.\n\nImagine you are building a web application that deals with users. You make an API request and receive an array of 100 entries which look like this one below:\n\n    {\n      \"_id\": \"5b420ae94fe6464ff91f5de8\",\n      \"index\": 0,\n      \"guid\": \"871eebf0-9983-4eb5-a0b5-59372a2fbecd\",\n      \"isActive\": true,\n      \"balance\": \"$1,268.06\",\n      \"age\": 41,\n      \"name\": {\n        \"first\": \"Pearlie\",\n        \"last\": \"Osborne\"\n      },\n      \"company\": \"PIVITOL\",\n      \"email\": \"pearlie.osborne@pivitol.net\",\n      \"phone\": \"+1 (992) 418-2307\",\n      \"address\": \"190 River Street, Spelter, Tennessee, 1088\",\n      \"registered\": \"Monday, April 18, 2016 7:35 AM\",\n      \"tags\": [\"ad\", \"magna\", \"aliqua\"],\n      \"friends\": [{\"id\": 0, \"name\": \"Whitney Snow\"}, {\"id\": 1, \"name\": \"Garza Hernandez\"}, {\"id\": 2,\"name\": \"Lourdes Conley\"}]\n    } \n      \n\nWith this library it is rather easy to perform various actions on your data.\n\n#### How It Works\n\n    const users = new DataField(arrayOfUsers)\n\nNow your data is stored in an instance of DataField class.\n\nEach method that performs any kind of selection or filtering returns a **new instance** of DataField and can be chained.\n\nMath methods return primitives and can not be chained\n\nTo extract your data use `.values()` or `toArray()`\n\n  \nLets filter our data. We need users who are 30 years old or older, but not 41 years old and have at least 2 friends, but less than 10. Also we want our list sorted by last name in descending order. Then we are done so we want an array out of that:\n\n    users.where('age').gte(30).not(41).where('friends').range(2, 10).sort({by: 'name.last', order: 'desc'}).toArray()\n    \nOr you can go more *object-oriented* way (this one below is kinda weird request although):\n\n```js\nusers.where('age').any({\n  range: [8, 88],\n  lte: 18,\n  gt: 60,\n  not: 42,\n  is: false\n})\n```\n\n\nThat's it. API is short and simple.\nAlso, read the [Documentation](https://tomkallen.github.io/datafield/)\n\n`npm i datafield`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexbykoff%2Fdatafield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexbykoff%2Fdatafield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexbykoff%2Fdatafield/lists"}