{"id":23705728,"url":"https://github.com/pouchdb/pouchdb-rewrite","last_synced_at":"2026-02-03T03:30:19.013Z","repository":{"id":36716727,"uuid":"41023293","full_name":"pouchdb/pouchdb-rewrite","owner":"pouchdb","description":"A PouchDB plug-in that allows you to re-use your CouchDB rewrites on the client side.","archived":false,"fork":false,"pushed_at":"2017-03-07T08:23:02.000Z","size":22,"stargazers_count":0,"open_issues_count":12,"forks_count":4,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-12-30T14:56:43.742Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pouchdb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-19T08:48:31.000Z","updated_at":"2016-02-05T10:37:23.000Z","dependencies_parsed_at":"2022-09-12T05:01:54.514Z","dependency_job_id":null,"html_url":"https://github.com/pouchdb/pouchdb-rewrite","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/pouchdb%2Fpouchdb-rewrite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pouchdb%2Fpouchdb-rewrite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pouchdb%2Fpouchdb-rewrite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pouchdb%2Fpouchdb-rewrite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pouchdb","download_url":"https://codeload.github.com/pouchdb/pouchdb-rewrite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239786254,"owners_count":19696772,"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-12-30T14:56:52.255Z","updated_at":"2026-02-03T03:30:16.910Z","avatar_url":"https://github.com/pouchdb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"pouchdb-rewrite\n===============\n\n[![Build Status](https://travis-ci.org/pouchdb/pouchdb-rewrite.svg?branch=master)](https://travis-ci.org/pouchdb/pouchdb-rewrite)\n[![Dependency Status](https://david-dm.org/pouchdb/pouchdb-rewrite.svg)](https://david-dm.org/pouchdb/pouchdb-rewrite)\n[![devDependency Status](https://david-dm.org/pouchdb/pouchdb-rewrite/dev-status.svg)](https://david-dm.org/pouchdb/pouchdb-rewrite#info=devDependencies)\n\nA PouchDB plug-in that allows you to re-use your CouchDB rewrites on the\nclient side. A browser version is available.\n\n#TODO: update, rst -\u003e md, integrate\n```rst\n.. _pouchdb-rewrite-plug-in:\n\nPouchDB Rewrite plug-in\n=======================\n+----------------------+--------------------+\n| NodeJS package name: | `pouchdb-rewrite`_ |\n+----------------------+--------------------+\n| Browser object name: | ``window.Rewrite`` |\n+----------------------+--------------------+\n\nFirst, make sure you understand CouchDB rewrites. A good starting point\nis `the rewrite documentation`_.\n\n.. _pouchdb-rewrite: https://www.npmjs.org/package/pouchdb-rewrite\n.. _the rewrite documentation: http://docs.couchdb.org/en/latest/api/ddoc/rewrites.html\n\n.. js:function:: Rewrite.rewrite(rewritePath[, options[, callback]])\n\n   Figures out where to redirect to, and then executes the corresponding\n   PouchDB function, with the appropriate arguments gotten from the\n   request object that has been generated from the ``options``\n   parameter.\n\n   :param string rewritePath: a path of the form\n       ``\"designDocName/rewrite/path\"``. Specifies the design document\n       to use the rewrites from, and the path you'd find in CouchDB\n       after the ``/_rewrite`` part of the URL. Keep in mind that you\n       can't specify a query parameter in the url form (i.e. no\n       ``?a=b``). Instead use the ``options.query`` parameter.\n   :param object options: A CouchDB request object stub. Important\n       properties of those for rewrites are ``options.query`` and\n       ``options.method``. An additional boolean option is available:\n       ``options.withValidation``, if true, this function routes to\n       ``db.validating*`` functions instead of ``db.*`` functions if\n       relevant.\n   :returns: whatever output the function that the rewrite routed to\n       produced. Or, in the case of an 'http' database, a CouchDB\n       response object.\n\n.. js:function:: Rewrite.rewriteResultRequestObject(rewritePath[, options[, callback]])\n\n   See the :js:func:`Rewrite.rewrite` function for information on the\n   parameters. The difference with it is that this function doesn't try\n   to route the rewrite to a function.\n\n   :returns: A CouchDB request object that points to the resource\n       obtained by following the redirect.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpouchdb%2Fpouchdb-rewrite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpouchdb%2Fpouchdb-rewrite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpouchdb%2Fpouchdb-rewrite/lists"}