{"id":21951341,"url":"https://github.com/hiswe/etherpad-api","last_synced_at":"2026-05-01T00:31:22.413Z","repository":{"id":57116071,"uuid":"152378448","full_name":"Hiswe/etherpad-api","owner":"Hiswe","description":"Utility to query etherpad-lite from a nodeJS application","archived":false,"fork":false,"pushed_at":"2023-01-06T12:25:47.000Z","size":486,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-03T22:32:45.614Z","etag":null,"topics":["api-wrapper","etherpad","etherpad-lite"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@hiswe/etherpad-api","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/Hiswe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-10-10T07:07:31.000Z","updated_at":"2018-12-10T11:39:22.000Z","dependencies_parsed_at":"2023-02-06T02:01:45.163Z","dependency_job_id":null,"html_url":"https://github.com/Hiswe/etherpad-api","commit_stats":null,"previous_names":["hiswe/query-etherpad"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hiswe%2Fetherpad-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hiswe%2Fetherpad-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hiswe%2Fetherpad-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hiswe%2Fetherpad-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hiswe","download_url":"https://codeload.github.com/Hiswe/etherpad-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244999193,"owners_count":20544863,"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-wrapper","etherpad","etherpad-lite"],"created_at":"2024-11-29T06:13:38.216Z","updated_at":"2026-05-01T00:31:22.369Z","avatar_url":"https://github.com/Hiswe.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# etherpad-api\n\n[![npm version](https://badge.fury.io/js/%40hiswe%2Fetherpad-api.svg)](https://badge.fury.io/js/%40hiswe%2Fetherpad-api) [![Build Status](https://travis-ci.org/Hiswe/etherpad-api.svg?branch=master)](https://travis-ci.org/Hiswe/etherpad-api)\n\nPromised based query to etherpad-lite\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n\n- [how it works](#how-it-works)\n- [configuration](#configuration)\n- [use](#use)\n- [full example](#full-example)\n- [class use](#class-use)\n- [other stuff](#other-stuff)\n  - [changelog](#changelog)\n  - [run the tests](#run-the-tests)\n  - [alternatives](#alternatives)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## how it works\n\nIt uses [request-promise-native](https://www.npmjs.com/package/request-promise-native) to call each [Etherpad API endpoints](http://etherpad.org/doc/v1.7.0/#index_usage)\n\nThe API are similar\n\n- Methods names are identical to the API documentation\n- The same goes for the params\n  You just have to pass them as an object\n\nBut there is some differences:\n\n- `Etherpad-api` will reject any Etherpad response [which code isn't 0](http://etherpad.org/doc/v1.7.0/#index_response_format)\n- All errors will be created by [http-errors](https://www.npmjs.com/package/http-errors)\n- It will error if you try to call an endpoint that isn't implemented on the Etherpad API version you're using\n\n## configuration\n\n```js\nconst Etherpad = require('@hiswe/etherpad-api')\n\nconst etherpad = new Etherpad({\n  apiKey: `6b95f6d270f4f719f1b70e8ad2f742deef94c5bccee7d495250c0fbb8cecefc7`,\n  // API KEY\n  url: `http://my-etherpad-server`,\n  // default: http://0.0.0.0:9001 (local etherpad server)\n  // full URL to your etherpad server\n  apiVersion: `1.0.0`\n  // default: latest (1.2.13)\n  // If you want to prevent your application from calling unsupported methods\n  timeout: 7000\n  // default: 1000\n  // request timeout\n})\n\n// now you have access to all etherpad methods…\n```\n\n## use\n\nAs an example: calling [getHTML](http://etherpad.org/doc/v1.7.0/#index_gethtml_padid_rev)\n\n```js\netherpad\n  .getHTML({ padID: `my-pad` })\n  .then(data =\u003e console.log(data))\n  .catch(error =\u003e console.log(error))\n```\n\nif you don't want to error on etherpad errors:\nadd `false` as the second parameter\n\n```js\netherpad\n  // add `false` as the second parameter\n  .getHTML({ padID: `a-pad-that-does-not-exist` }, false)\n  .then(data =\u003e {\n    // data will be null because “padID does not exist”\n    assert.equal(data, null)\n    console.log(data)\n  })\n  .catch(error =\u003e console.log(error))\n```\n\n## full example\n\n```js\nconst express = require('express')\nconst Etherpad = require('@hiswe/etherpad-api')\n\nconst app = express()\nconst etherpad = new Etherpad({\n  url: `http://my-etherpad-server`,\n  apiKey: `6b95f6d270f4f719f1b70e8ad2f742deef94c5bccee7d495250c0fbb8cecefc7`,\n})\n\napp.get(`/pads/:padID`, (req, res) =\u003e {\n  const { padID } = req.params\n  etherpad\n    .getHTML({ padID })\n    .then(padData =\u003e res.send(padData))\n    .catch(error =\u003e res.status(error.statusCode).json(error))\n})\n```\n\n## class use\n\nalternatively you could use/extend the original class\n\n```js\nconst Etherpad = require('@hiswe/etherpad-api')\n\nclass MyEtherpad extends Etherpad {\n  // …you can extend the class here\n}\n\nconst etherpad = new MyEtherpad({\n  url: `http://my-etherpad-server`,\n  apiKey: `6b95f6d270f4f719f1b70e8ad2f742deef94c5bccee7d495250c0fbb8cecefc7`,\n})\n```\n\n## other stuff\n\n### changelog\n\nSee [CHANGELOG.md](https://github.com/Hiswe/etherpad-api/blob/master/CHANGELOG.md)\n\n### run the tests\n\n- clone the project\n- `npm install`\n- `npm test`\n\n### alternatives\n\n- [etherpad-lite-client](https://www.npmjs.com/package/etherpad-lite-client)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiswe%2Fetherpad-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhiswe%2Fetherpad-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiswe%2Fetherpad-api/lists"}