A Node.js library for interacting with the Grepper API to browse and manage code snippets. This library provides an intuitive interface to search, retrieve, and update code snippets programmatically.
- Search Answers: Find answers based on a query string.
- Retrieve an Answer: (Currently unavailable) Refer to the official documentation.
- Update an Answer: (Currently unavailable) Refer to the official documentation.
- A Grepper Account.
- A valid Grepper API Key.
Install the library using npm or yarn:
npm install grepper-node
# or
yarn add grepper-node
Create a new client instance using your Grepper API key:
import { Client } from 'grepper-node'
const client = new Client({
api_key: '<your_api_key>'
});
Use the search
method to find answers by a query string:
const answers = await client.search('how to build docker image');
console.log(answers);
// output:
// [
// {
// object: string,
// id: number,
// content: string,
// author_name: string,
// title: string,
// upvotes: number,
// downvotes: number
// }
// ]
This endpoint is currently unavailable. Refer to the official documentation.
// Example usage when available:
const answer = await client.answer(343661);
console.log(answer);
// output:
// {
// object: string,
// id: number,
// content: string,
// author_name: string,
// title: string,
// upvotes: number,
// downvotes: number
// }
This endpoint is currently unavailable. Refer to the official documentation.
// Example usage when available:
const status = await client.update(343661, 'new answer content here');
console.log(status);
// output:
// {
// id: number,
// success: boolean
// }
We welcome contributions! To get started: CONTRIBUTING
This project is licensed under the MIT License.