{"id":19710020,"url":"https://github.com/coderaiser/node-restafary","last_synced_at":"2025-04-05T19:11:20.571Z","repository":{"id":24321888,"uuid":"27718471","full_name":"coderaiser/node-restafary","owner":"coderaiser","description":"REST for CRUD file operations","archived":false,"fork":false,"pushed_at":"2024-12-20T11:56:46.000Z","size":415,"stargazers_count":14,"open_issues_count":2,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T18:06:22.360Z","etag":null,"topics":["crud","expressjs","middleware","nodejs","rest"],"latest_commit_sha":null,"homepage":null,"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/coderaiser.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"LICENSE","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":"2014-12-08T14:25:16.000Z","updated_at":"2024-12-20T11:56:50.000Z","dependencies_parsed_at":"2024-03-16T17:27:06.685Z","dependency_job_id":"ae1a73fc-dfff-412c-91d1-e31f085427f9","html_url":"https://github.com/coderaiser/node-restafary","commit_stats":{"total_commits":500,"total_committers":3,"mean_commits":"166.66666666666666","dds":"0.29800000000000004","last_synced_commit":"3970252999802f6e9083864a61c6b14eea603c9c"},"previous_names":[],"tags_count":145,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderaiser%2Fnode-restafary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderaiser%2Fnode-restafary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderaiser%2Fnode-restafary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderaiser%2Fnode-restafary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderaiser","download_url":"https://codeload.github.com/coderaiser/node-restafary/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247386262,"owners_count":20930619,"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":["crud","expressjs","middleware","nodejs","rest"],"created_at":"2024-11-11T22:05:56.916Z","updated_at":"2025-04-05T19:11:20.552Z","avatar_url":"https://github.com/coderaiser.png","language":"JavaScript","readme":"# Restafary [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL]\n\n**REST** for **CRUD** file operations.\n\n## What is it?\n\n**RE**presentational **S**tate **T**ransfer is an abstraction of the architecture of the World Wide Web.\n\n**C**reate **R**ead **U**pdate **D**elete is 4 basic functions of persistent storage.\n\n## Install\n\n`npm i restafary --save`\n\n## REST\n\n|Name         |Method   |Query          |Body               |Description                    |\n|:------------|:--------|:--------------|:------------------|:------------------------------|\n|`fs`         |`GET`    |               |                   |get file or dir content        |\n|             |         |`sort`         |                   |sort dir content by `name`,    |\n|             |         |               |                   |`size` or `time`               |\n|             |         |`order`        |                   |order of sorting, can be:      |\n|             |         |               |                   |`asc` or `desc`                |\n|             |         |`raw`          |                   |get file or raw dir content    |\n|             |         |`size`         |                   |get file or dir size           |\n|             |         |`raw-size`      |                   |get raw size                   |\n|             |         |`hash`         |                   |get file hash                  |\n|             |         |`download`     |                   |content disposition attachment |\n|             |`PUT`    |               |file content       |create/write file              |\n|             |         |`unzip`        |file content       |unzip and create/write file    |\n|             |         |`dir`          |                   |create dir                     |\n|             |`PATCH`  |               |diff               |patch file                     |\n|             |`DELETE` |               |                   |delete file                    |\n|             |         |`files`        |Array of names     |delete files                   |\n\n## How to use?\n\n```js\nconst restafary = require('restafary');\nconst http = require('node:http');\nconst express = require('express');\n\nconst app = express();\nconst server = http.createServer(app);\n\nconst port = 1337;\nconst ip = '0.0.0.0';\n\napp.use(restafary({\n    prefix: '/fs', // default\n    root: '/', // default, can be string or function\n}));\n\napp.use(express.static(__dirname));\nserver.listen(port, ip);\n```\n\n## License\n\nMIT\n\n[NPMIMGURL]: https://img.shields.io/npm/v/restafary.svg?style=flat\n[BuildStatusURL]: https://github.com/coderaiser/node-restafary/actions?query=workflow%3A%22Node+CI%22 \"Build Status\"\n[BuildStatusIMGURL]: https://github.com/coderaiser/node-restafary/workflows/Node%20CI/badge.svg\n[LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat\n[NPMURL]: https://npmjs.org/package/restafary \"npm\"\n[LicenseURL]: https://tldrlegal.com/license/mit-license \"MIT License\"\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderaiser%2Fnode-restafary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderaiser%2Fnode-restafary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderaiser%2Fnode-restafary/lists"}