{"id":19134065,"url":"https://github.com/umbrellio/object-presenter","last_synced_at":"2025-05-06T19:27:58.142Z","repository":{"id":57312709,"uuid":"160841595","full_name":"umbrellio/object-presenter","owner":"umbrellio","description":"Simple, solid object presenters","archived":false,"fork":false,"pushed_at":"2020-12-23T10:38:35.000Z","size":29,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2023-12-20T11:02:33.634Z","etag":null,"topics":["decorator","presenter"],"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/umbrellio.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":"2018-12-07T15:31:20.000Z","updated_at":"2022-06-09T13:30:39.000Z","dependencies_parsed_at":"2022-09-20T22:57:04.036Z","dependency_job_id":null,"html_url":"https://github.com/umbrellio/object-presenter","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbrellio%2Fobject-presenter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbrellio%2Fobject-presenter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbrellio%2Fobject-presenter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbrellio%2Fobject-presenter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umbrellio","download_url":"https://codeload.github.com/umbrellio/object-presenter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223793243,"owners_count":17203775,"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":["decorator","presenter"],"created_at":"2024-11-09T06:25:18.860Z","updated_at":"2024-11-09T06:25:19.375Z","avatar_url":"https://github.com/umbrellio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# object-presenter\n\n[![Build Status](https://travis-ci.org/umbrellio/object-presenter.svg?branch=master)](https://travis-ci.org/umbrellio/object-presenter)\n[![Coverage Status](https://coveralls.io/repos/github/umbrellio/object-presenter/badge.svg?branch=master)](https://coveralls.io/github/umbrellio/object-presenter?branch=master)\n\nSimple, solid object presenters.\n\n## Installation\n\nInstall with yarn:\n\n```sh\nyarn add object-presenter\n# or npm:\nnpm i -S object-presenter\n```\n\n## Usage\n\n```js\nimport ObjectPresenter from 'object-presenter'\nimport moment from 'moment'\n\nclass UserPresenter extends ObjectPresenter {\n  get fullName() {\n    return `${this.object.firstName} ${this.object.lastName}`\n  }\n\n  get birthdate() {\n    return moment(this.object.birthdate).format('MMM Do YY')\n  }\n}\n\nconst rawUser = { firstName: 'Elon', lastName: 'Musk', birthdate: 46976100000 }\nconst user = new UserPresenter(rawUser)\n\nconsole.log(user.fullName) // =\u003e Elon Musk\nconsole.log(user.firstName) // =\u003e Elon\nconsole.log(user.birthdate) // =\u003e Jun 28th 71\n\nconsole.log(user.serialize()) // =\u003e { firstName: 'Elon', lastName: 'Musk', fullName: 'Elon Musk', birthdate: 'Jun 28th 71' }\n```\n\nTo use in native ES6, import `object-presenter/es6` instead.\n\n## License\n\nReleased under MIT License.\n\n## Authors\n\nCreated by Alexander Komarov.\n\n\u003ca href=\"https://github.com/umbrellio/\"\u003e\n\u003cimg style=\"float: left;\" src=\"https://umbrellio.github.io/Umbrellio/supported_by_umbrellio.svg\" alt=\"Supported by Umbrellio\" width=\"439\" height=\"72\"\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumbrellio%2Fobject-presenter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumbrellio%2Fobject-presenter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumbrellio%2Fobject-presenter/lists"}