{"id":22279023,"url":"https://github.com/marklogic/node-client-api","last_synced_at":"2025-10-07T23:16:48.453Z","repository":{"id":16543255,"uuid":"19296804","full_name":"marklogic/node-client-api","owner":"marklogic","description":"The MarkLogic Node.js Client API","archived":false,"fork":false,"pushed_at":"2024-04-10T01:14:50.000Z","size":10553,"stargazers_count":53,"open_issues_count":5,"forks_count":48,"subscribers_count":29,"default_branch":"master","last_synced_at":"2024-04-14T13:08:22.918Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://docs.marklogic.com/jsdoc/index.html","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marklogic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2014-04-30T01:12:46.000Z","updated_at":"2024-04-19T19:25:26.949Z","dependencies_parsed_at":"2023-02-17T22:15:52.097Z","dependency_job_id":"270e65cd-635a-4bd4-ae9c-de2acde7a018","html_url":"https://github.com/marklogic/node-client-api","commit_stats":{"total_commits":1549,"total_committers":34,"mean_commits":45.55882352941177,"dds":0.6307295029051001,"last_synced_commit":"f004f8c02c3ad575dc1daf488be9d3133c7179ee"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marklogic%2Fnode-client-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marklogic%2Fnode-client-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marklogic%2Fnode-client-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marklogic%2Fnode-client-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marklogic","download_url":"https://codeload.github.com/marklogic/node-client-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247713258,"owners_count":20983683,"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-03T15:17:49.654Z","updated_at":"2025-10-07T23:16:48.446Z","avatar_url":"https://github.com/marklogic.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MarkLogic Node.js Client API\n\nThe MarkLogic Node.js Client API provides access to the MarkLogic database\nfrom Node.js applications.\n\n## Features\n\n* Writing, reading, patching, and deleting documents in JSON, XML, text, or binary formats\n* Querying over documents including parsing string queries, extracting properties, and calculating facets\n* Projecting tuples (like table rows) out of documents\n* Single transactions and multi-statement transactions for database changes\n* Writing, reading, and deleting graphs and executing SPARQL queries over graphs\n* Extending the built-in services or evaluating or invoking your own JavaScript or XQuery on the server\n* Basic, digest, certificate, Kerberos, and SAML authentication\n* Import libraries as JavaScript mjs modules\n* Data Services First - MarkLogic's support for microservices\n* Optic query DSL, document matching, relevance, multiple groups\n* Generate query based views, redaction on rows\n* Data Movement SDK - move large amounts of data into, out of, or within a MarkLogic cluster\n\n## Getting Started\n\nYou can install the marklogic package as a dependency for your Node.js project\nusing [npm](https://www.npmjs.com/package/marklogic):\n\n```\nnpm install marklogic --save\n```\n\nFor Windows OS please use the below for Node Client 2.9.1:\n```\nnpm install marklogic --save --ignore-scripts\n```\n\nWith the marklogic package installed, the following inserts two documents in a\ncollection into the Documents database using MarkLogic's built-in REST server\nat port 8000:\n\n```javascript\nconst marklogic = require('marklogic');\n\nconst db = marklogic.createDatabaseClient({\n  host:     'localhost',\n  port:     '8000',\n  database: 'Documents',\n  user:     'admin',\n  password: 'admin',\n  authType: 'DIGEST',\n  // enableGzippedResponses is optional and can be set to true in order to request MarkLogic to compress the response for better performance,\n    // the client will automatically decompress the response before it returns a value.\n  enableGzippedResponses: true\n});\n\n// For MarkLogic Cloud\nconst db = marklogic.createDatabaseClient({\n    apiKey:   'changeme',\n    host:     'example.beta.marklogic.com',\n    authType: 'cloud',\n    // basePath is optional.\n    basePath: '/marklogic/test',\n    // accessTokenDuration (in seconds) is optional and can be used to customize the expiration of the access token.\n    accessTokenDuration: 10,\n    // enableGzippedResponses is optional and can be set to true in order to request MarkLogic to compress the response for better performance,\n    // the client will automatically decompress the response before it returns a value.\n    enableGzippedResponses: true\n});\n\n// For OAUTH\nconst db = marklogic.createDatabaseClient({\n    host:     'localhost',\n    port:     '8000',\n    authType: 'oauth',\n    oauthToken: '\u003cOAUTH Token\u003e'\n});\n\ndb.createCollection(\n  '/books',\n  {author: 'Beryl Markham', ...},\n  {author: 'WG Sebald',     ...}\n  )\n.result(function(response) {\n    console.log(JSON.stringify(response, null, 2));\n  }, function (error) {\n    console.log(JSON.stringify(error, null, 2));\n  });\n```\n\n### Resources\n\n* [Node.js Client API Documentation](https://docs.marklogic.com/jsdoc/index.html)\n* [Node.js Application Developer's Guide](https://docs.progress.com/bundle/marklogic-server-develop-with-node-js-11/page/topics/intro.html)\n* [MarkLogic Overview](https://www.progress.com/marklogic)\n\n### Code Examples\n\nThe Node.js Client API ships with code examples to supplement the examples\nin the online resources. To run the examples, follow the instructions here:\n\n    examples/1readme.txt\n\n### Generating Documentation Locally\n\nAfter installing the project dependencies (including the [gulp](http://gulpjs.com/)\nbuild system), you can build the reference documentation locally from the root\ndirectory of the marklogic package:\n\n    npm run doc\n\nThe documentation is generated in a doc subdirectory. The documentation can also be\naccessed online [here](https://docs.marklogic.com/jsdoc/index.html).\n\n## Support\n\nThe MarkLogic Node.js Client API is maintained by MarkLogic Engineering.\nIt is designed for use in production applications with MarkLogic Server.\nEveryone is encouraged to file bug reports, feature requests, and pull\nrequests through GitHub. This input is critical and will be carefully\nconsidered, but we can’t promise a specific resolution or timeframe for\nany request. In addition, MarkLogic provides technical support\nfor [release tags](https://github.com/marklogic/node-client-api/releases)\nof the Node.js Client API to licensed customers under the terms outlined\nin the [Support Handbook](http://www.marklogic.com/files/Mark_Logic_Support_Handbook.pdf).\nFor more information or to sign up for support,\nvisit [help.marklogic.com](http://help.marklogic.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarklogic%2Fnode-client-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarklogic%2Fnode-client-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarklogic%2Fnode-client-api/lists"}