{"id":13810378,"url":"https://github.com/outlandishideas/wp-api-response-modify","last_synced_at":"2025-05-14T10:33:13.290Z","repository":{"id":146528574,"uuid":"64123106","full_name":"outlandishideas/wp-api-response-modify","owner":"outlandishideas","description":"Makes WP API response JSON sensible","archived":true,"fork":false,"pushed_at":"2017-09-17T10:57:14.000Z","size":56,"stargazers_count":7,"open_issues_count":2,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-12T05:40:57.394Z","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/outlandishideas.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}},"created_at":"2016-07-25T09:49:51.000Z","updated_at":"2025-02-16T04:22:15.000Z","dependencies_parsed_at":"2024-01-15T13:35:35.312Z","dependency_job_id":null,"html_url":"https://github.com/outlandishideas/wp-api-response-modify","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outlandishideas%2Fwp-api-response-modify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outlandishideas%2Fwp-api-response-modify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outlandishideas%2Fwp-api-response-modify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outlandishideas%2Fwp-api-response-modify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/outlandishideas","download_url":"https://codeload.github.com/outlandishideas/wp-api-response-modify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254121131,"owners_count":22018108,"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-08-04T02:00:51.679Z","updated_at":"2025-05-14T10:33:08.261Z","avatar_url":"https://github.com/outlandishideas.png","language":"JavaScript","funding_links":[],"categories":["WordPress Plugins"],"sub_categories":[],"readme":"# wp-api-response-modify\n\n\u003e Makes WP API response JSON sensible\n\nMade with ❤ at [@outlandish](http://www.twitter.com/outlandish)\n\n\u003ca href=\"http://badge.fury.io/js/wp-api-response-modify\"\u003e\u003cimg alt=\"npm version\" src=\"https://badge.fury.io/js/wp-api-response-modify.svg\"\u003e\u003c/a\u003e\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)\n\nMakes response JSON from the WP API sensible. By default it...\n\n- transforms properties to camel-case\n- flattens objects with a single property `rendered`\n- lifts embedded entities (author, featured media, etc.)\n- removes the `_links` property\n\nSee the [list of effects](#effects) for more.\n\n## Install\n\n```sh\nnpm install --save wp-api-response-modify\n```\n\n## Import\n\n```js\n// ES2015\nimport modify from 'wp-api-response-modify'\n\n// CommonJS\nvar modify = require('wp-api-response-modify')\n```\n\n## Usage\n\n### `modify(response[, effects]) : Object`\n\nMake a WP API response sensible.\n\n- __response__ {Object} Response from WP-API\n- [__effects__] {Array} _(optional)_ Effects to apply to the response\n\nReturns the modified response.\n\n## Effects\n\nAll effects are available at `modify.effects`, e.g. `modify.effects.flattenRenderedProps`.\n\nExample: `featured_media =\u003e featuredMedia`\n\n### `flattenRenderedProps`\n\nFlatten any object that has a single property `rendered`.\n\nExample:\n\n```js\n{ content: { rendered: 'content string' } }\n// becomes...\n{ content: 'content string' }\n```\n\n### `liftEmbeddedAuthor`\n\nReplace the author field with the embedded author entity.\n\nExample:\n\n```js\n{ author: 12, _embedded: { author: { id: 12, ... } } }\n// becomes...\n{ author: { id: 12, ... } }\n```\n\n### `liftEmbeddedFeaturedMedia`\n\nReplace the `featured_media` field with the value of the embedded `wp:featuredmedia`.\n\n### `removeLinks`\n\nRemove the `_links` property.\n\n### `camelize`\n\nTransform all property names to camel-case in the response.\n\n## Contributing\n\nAll pull requests and issues welcome!\n\nIf you're not sure how, check out Kent C. Dodds'\n[great video tutorials on egghead.io](https://egghead.io/lessons/javascript-identifying-how-to-contribute-to-an-open-source-project-on-github)!\n\n## Author \u0026 License\n\n`wp-api-response-modify` was created by [Outlandish](https://twitter.com/outlandish) and is released under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutlandishideas%2Fwp-api-response-modify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foutlandishideas%2Fwp-api-response-modify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutlandishideas%2Fwp-api-response-modify/lists"}