{"id":15175688,"url":"https://github.com/codjix/rentry-co","last_synced_at":"2026-01-08T09:02:04.473Z","repository":{"id":254510280,"uuid":"846296377","full_name":"codjix/rentry-co","owner":"codjix","description":"A Full CRUD super-lite rentry.co wrapper with typescript support and no-dependencies library.","archived":false,"fork":false,"pushed_at":"2024-09-19T00:00:44.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T03:38:30.732Z","etag":null,"topics":["api","express","library","markdown","rentry-co"],"latest_commit_sha":null,"homepage":"http://codjix.github.io/rentry-co/","language":"TypeScript","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/codjix.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-22T23:11:28.000Z","updated_at":"2024-12-25T23:40:59.000Z","dependencies_parsed_at":"2024-09-23T06:01:56.918Z","dependency_job_id":"073d08ea-920d-4682-87b0-9c9abf70e3bb","html_url":"https://github.com/codjix/rentry-co","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"3db8edd4ce644e170bf4ca7f85a59504717f7798"},"previous_names":["cto4/rentry-co","codjix/rentry-co"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codjix%2Frentry-co","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codjix%2Frentry-co/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codjix%2Frentry-co/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codjix%2Frentry-co/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codjix","download_url":"https://codeload.github.com/codjix/rentry-co/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249494026,"owners_count":21281655,"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":["api","express","library","markdown","rentry-co"],"created_at":"2024-09-27T12:40:17.113Z","updated_at":"2026-01-08T09:02:04.386Z","avatar_url":"https://github.com/codjix.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rentry-Co\r\n\r\nA Full CRUD super-lite rentry.co wrapper with typescript support and no-dependencies library.\r\n\r\n## Features\r\n\r\n- create entries\r\n- read entries\r\n- update entries\r\n- delete entries\r\n- typescript support\r\n- built-in express routes\r\n- no-dependencies\r\n\r\n## Installation\r\n\r\n```sh\r\nnpm i rentry-co\r\n```\r\n\r\n## Usage\r\n\r\nImport the library\r\n\r\n```ts\r\n// src/lib/rentry.js\r\n\r\n// CommonJS\r\nconst RentryCo = require(\"rentry-co\");\r\n// ESM\r\nimport RentryCo from \"rentry-co\";\r\n\r\n/*=============================*/\r\n\r\n// Use It\r\nconst rentry = new RentryCo();\r\nexport default rentry;\r\n```\r\n\r\n### Create a new entry\r\n\r\n```ts\r\nasync function test() {\r\n  // id is optional, skip for random id\r\n  var res = await rentry.create({\r\n    id: \"\u003cID\u003e\",\r\n    content: \"Hello World\",\r\n  });\r\n  console.log(res);\r\n}\r\n```\r\n\r\nOutput :\r\n\r\n\u003e save token \u0026 id for feature use !\r\n\r\n```json\r\n{ \"status\": \"200\", \"token\": \"abxx12xx\", \"id\": \"abc123\" }\r\n```\r\n\r\n### Read entry\r\n\r\n```ts\r\nasync function test() {\r\n  var res = await rentry.read({ id: \"\u003cID\u003e\" });\r\n  console.log(res);\r\n}\r\n```\r\n\r\nOutput :\r\n\r\n```json\r\n{ \"status\": \"200\", \"content\": \"## Hi\\nHello World\" }\r\n```\r\n\r\n### Update an existing entry\r\n\r\n```ts\r\nasync function test() {\r\n  var res = await rentry.update({\r\n    id: \"\u003cID\u003e\",\r\n    token: \"\u003cTOKEN\u003e\",\r\n    content: \"## Hi\\nHello World\",\r\n  });\r\n  console.log(res);\r\n}\r\n```\r\n\r\nOutput :\r\n\r\n```json\r\n{ \"status\": \"200\", \"content\": \"OK\" }\r\n```\r\n\r\n### Delete entry\r\n\r\n```ts\r\nasync function test() {\r\n  var res = await rentry.delete({\r\n    id: \"\u003cID\u003e\",\r\n    token: \"\u003cTOKEN\u003e\",\r\n  });\r\n  console.log(res);\r\n}\r\n```\r\n\r\nOutput :\r\n\r\n```json\r\n{ \"status\": \"200\", \"content\": \"OK\" }\r\n```\r\n\r\n### Express routes\r\n\r\nUse built-in expres routes from `RentryCoExpress` to create api.\r\n\r\n\u003e note: `body-parser`, `cors` are required, install with `npm i body-parser cors`\r\n\r\n```ts\r\nimport express from \"express\";\r\nimport bodyParser from \"body-parser\";\r\nimport cors from \"cors\";\r\n\r\nimport RentryCoExpress from \"./index\";\r\n\r\nconst app = express();\r\napp.use(bodyParser.text());\r\napp.use(cors());\r\n\r\napp.use(\"/api/rentry\", RentryCoExpress);\r\n\r\napp.listen(3000, () =\u003e {\r\n  console.log(\"server started at: http://localhost:3000\");\r\n});\r\n```\r\n\r\n## License\r\n\r\n[MIT License](https://github.com/cto4/rentry-co/blob/main/LICENSE)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodjix%2Frentry-co","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodjix%2Frentry-co","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodjix%2Frentry-co/lists"}