{"id":25268330,"url":"https://github.com/food-static-data/sd","last_synced_at":"2025-10-27T06:31:38.348Z","repository":{"id":42467274,"uuid":"169665193","full_name":"Food-Static-Data/sd","owner":"Food-Static-Data","description":"Food static data wrapper","archived":false,"fork":false,"pushed_at":"2024-09-27T09:36:22.000Z","size":65420,"stargazers_count":9,"open_issues_count":56,"forks_count":13,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-29T10:46:38.338Z","etag":null,"topics":["food-technology","ingredients","json","measurements","recipes"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Food-Static-Data.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-02-08T00:34:50.000Z","updated_at":"2022-04-04T13:01:25.000Z","dependencies_parsed_at":"2022-08-22T05:50:33.540Z","dependency_job_id":null,"html_url":"https://github.com/Food-Static-Data/sd","commit_stats":null,"previous_names":["groceristar/sd"],"tags_count":48,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Food-Static-Data%2Fsd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Food-Static-Data%2Fsd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Food-Static-Data%2Fsd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Food-Static-Data%2Fsd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Food-Static-Data","download_url":"https://codeload.github.com/Food-Static-Data/sd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238454706,"owners_count":19475297,"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":["food-technology","ingredients","json","measurements","recipes"],"created_at":"2025-02-12T10:29:29.966Z","updated_at":"2025-10-27T06:31:32.981Z","avatar_url":"https://github.com/Food-Static-Data.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/36658223?s=200\u0026v=4\" alt=\"\"/\u003e\u003c/p\u003e\n\u003cp\u003eStatic food wrapper module\u003c/p\u003e\n\n[![Build Status](https://travis-ci.org/GroceriStar/sd.svg?branch=master)](https://travis-ci.org/GroceriStar/sd)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n[![Coveralls](http://img.shields.io/coveralls/GroceriStar/sd.svg?style=flat)](https://coveralls.io/r/GroceriStar/sd)\n[![Maintainability](https://api.codeclimate.com/v1/badges/ee4c65ca8e215b11a34b/maintainability)](https://codeclimate.com/github/GroceriStar/sd/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/ee4c65ca8e215b11a34b/test_coverage)](https://codeclimate.com/github/GroceriStar/sd/test_coverage)\n[![npm version](http://img.shields.io/npm/v/@groceristar/sd-wrapper.svg?style=flat)](https://npmjs.org/package/@groceristar/sd-wrapper \"View this project on npm\")\n\n# Table of Contents\n\n- [Quick Start](#quick-start)\n- [What's included](#installation)\n- [Bugs and feature requests](#code-example)\n- [Documentation](#tests)\n- [Contributors](#contributors)\n\n## Quick Start\n\nSeveral quick start options are available:\n\n- Clone the repo: `git clone https://github.com/GroceriStar/sd.git`\n- Install with npm: `npm install @groceristar/sd-wrapper`\n- Install with yarn: `yarn add @groceristar/sd-wrapper`\n\n## What's included\n\nWithin the download you'll find the following directories and files, logically grouping common assets and providing both compiled and minified variations. You'll see something like this:\n\n```\n.\n├── docs\n│   └── Readme.md           # Secondary information about project\n/- update with our new folder changes /\n└──package                  # Folder contains src folder and configuration files\n    ├── dist                # Output folder for [NPM compiler] commands\n    ├──src                  # Folder with static JSON files. WTF what is going on here\n    └── test\n    package.json\n    babel.config.js\n    jest.config.js\n    rollup.config.js\n    jsonlint.config.js\n    lint-staged.config.js\n    .eslintrc.json\n    .huskyrc.js\n    .snyk\n    CONTRIBUTING.md\n.gitignore\nREADME.md\ntravis.yml\nrenovate.json\nSECURITY.md\nLICENSE\n```\n\nWe provide compiled JS, as well as compiled and minified JS.\n\n\nhttps://github.com/Food-Static-Data/sd/projects/1\n\n\n## Bugs and feature requests\n\nHave a bug or a feature request? Please first read the issue guidelines and search for existing and closed issues. If your problem or idea is not addressed yet, please open a new issue.\n\n## Documentation\n\nAre we have documentation? If no, it should be written\n\n\n\n\n\n### NPM commands\n\n#### Compiler commands\n\n- `yarn bundle` or `npm run bundle`: in folder `dist` will be compiled three files with `.cjs`, `es.js`, `iife.js` extensions. Files contain output data of recipes, departments, etc.\n- `yarn dev` or `npm run dev`: compile and watch for changes (run watcher)\n- `jest`: Run tests through project\n- `npm run jsonlint` or `yarn jsonlint`: validate JSON output files\n- `npm run code-fix` or `yarn code-fix`: run [standard](https://www.npmjs.com/package/standard) linter with write permissions\n\n#### Generator commands\n\n- `npm run generate` or `yarn generate`: generate all recipes in folder `dist`.\n  More detailed information [here](#how-to-generate)\n\n#### Parser commands\n\n- `npm run parseCsv` or `yarn parseCsv` : parse from csv to json Food Composition\n\n## How to generate additional files\n\nTo run generator (it will run in writeFile.js function writeFiles()) `npm run generateFiles` to know if writing is success in console you will see `file generated successfully!` it will write multiple files.\n\nIn function `writeFiles()` should be array of files. In array config of objects.\nFirst property in object should be `name` and value filename, the second `data` and in value set function that returns data.\nBy default generating files happens in `/src/data`\n\nAlso you can write one file using function `writeFile()` just give it two parameters first - `path`, second `data` that will need to write. Data should be object and JSON format.\n\n## How to split json into single elements\n\n**--- update information about how to use generator module ---**\n\n```\nconst writeFile = require('path to sd/generator/writeFile.js')\nvar path = \"/path/of/the/file/\"\nwriteFile.splitObject(path, 'filename.json', 1, writeFile.combineObject, ['key1', 'key2'])\n```\n\n**getFileInfo('path_of_directory')** - returns a list of files present in the directory.\n\nSample Output:\n\n```\n[ 'some_file_abc.json',\n  'some_file_pqr.json',\n  'some_file_xyz.json' ]\n```\n\n**getFileInfo('path_of_directory',1)** - returns contents of all json files present in the directory.\n\nSample Output:\n\n```\n[ { departments: [ 'Other' ],\n    id: 14,\n    name: 'number-four9',\n    img: false,\n    desc: false,\n    slug: false },\n  { departments: [ 'Other' ],\n    id: 7,\n    name: 'Rabel Dietitian',\n    img: false,\n    desc: false,\n    slug: false } ]\n```\n\n**getFileInfo('path_of_directory',1,'fileName')** - returns content of the given file from the directory.\n\nSample Output:\n\n```\n{ departments: [ 'Other' ],\n  id: 14,\n  name: 'number-four9',\n  img: false,\n  desc: false,\n  slug: false }\n```\n\n## Contributors\n\n@vadim9999, @atherdon, @wahaj-47, @tihaami, @EbrahimKreem, @elnur004, @hirdbluebird, @Beni03, @Edebo, @uniyalprashant9\n\n#### publish at npm\n\n```\n- npm login\n- - username\n- - password\n- - email\n- npm version patch\n- git commit\n- npm publish\n- git push --tags (if tag was not created - https://www.atlassian.com/git/tutorials/inspecting-a-repository/git-tag)\n\n```\n\n## Support\n\n**Bugs and requests**: submit them through the project's issues tracker.\u003cbr\u003e\n[![Issues](http://img.shields.io/github/issues/GroceriStar/sd.svg)](https://github.com/GroceriStar/sd/issues)\n\n\u003c!-- Creators\n Thanks\n Copyright and license\n--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffood-static-data%2Fsd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffood-static-data%2Fsd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffood-static-data%2Fsd/lists"}