{"id":16329982,"url":"https://github.com/luin/tser","last_synced_at":"2025-05-15T09:14:27.217Z","repository":{"id":23843896,"uuid":"27221470","full_name":"luin/tser","owner":"luin","description":"A general client for RESTful API","archived":false,"fork":false,"pushed_at":"2014-12-31T08:57:54.000Z","size":208,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T12:05:59.748Z","etag":null,"topics":[],"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/luin.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":"2014-11-27T11:00:23.000Z","updated_at":"2014-12-31T08:57:55.000Z","dependencies_parsed_at":"2022-08-05T23:30:43.529Z","dependency_job_id":null,"html_url":"https://github.com/luin/tser","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/luin%2Ftser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luin%2Ftser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luin%2Ftser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luin%2Ftser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luin","download_url":"https://codeload.github.com/luin/tser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254310517,"owners_count":22049470,"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-10-10T23:18:04.200Z","updated_at":"2025-05-15T09:14:27.201Z","avatar_url":"https://github.com/luin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Tser\n====\n\nA general node.js client for RESTful API\n\n[![Build Status](https://travis-ci.org/luin/tser.png?branch=master)](https://travis-ci.org/luin/tser)\n\nInstall\n-------\n\n    $ npm install tser\n\nUsage\n-----\n\nTser is the reversed 'Rest' and it can turn any RESTful API into a node.js client.\n\n```javascript\nvar tser = require('tser');\n\nvar api = tser('http://demo7394653.mockable.io/');\n\n// GET http://domain.com/api/users/12/projects?status=active\napi.users(12).projects.get({ status: 'active' }).then(function(res) {\n  console.log(res);\n});\n```\n\n```javascript\nvar tser = require('tser');\n\nvar api = tser('http://demo7394653.mockable.io/');\n\n// POST http://demo7394653.mockable.io/api/users\n//  with json body { name: 'Bob' }\napi.users.post({ name: 'Bob' }).then(function(res) {\n  console.log(res);\n});\n```\n\n```javascript\nvar tser = require('tser');\n\nvar api = tser('http://demo7394653.mockable.io/', {\n  transform: {\n    request: function(options) {\n      if (this.auth) {\n        options.auth = this.auth;\n      }\n      return options;\n    }\n  }\n});\n\n// GET http://demo7394653.mockable.io/api/users/me\napi.users('me').get().catch(function(err) {\n  // 401\n});\n\napi.$set('auth', {\n  user: 'abc',\n  pass: 'pass'\n});\n\n// GET http://demo7394653.mockable.io/api/users/me\napi.users('me').get().then(function(me) {\n    console.log(me);\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluin%2Ftser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluin%2Ftser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluin%2Ftser/lists"}