https://github.com/moo-w/geasty
Simple and easy to use Gist API client
https://github.com/moo-w/geasty
api api-client gist github typescript-library
Last synced: about 1 year ago
JSON representation
Simple and easy to use Gist API client
- Host: GitHub
- URL: https://github.com/moo-w/geasty
- Owner: moo-w
- License: mit
- Created: 2025-04-01T11:20:35.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-18T10:25:18.000Z (about 1 year ago)
- Last Synced: 2025-05-17T06:11:25.762Z (about 1 year ago)
- Topics: api, api-client, gist, github, typescript-library
- Language: TypeScript
- Homepage:
- Size: 69.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# geasty
Simple and easy to use TypeScript library for interacting with GitHub [Gist](https://gist.github.com) API.
## Features
- Full CRUD operations for gists
- Support for forks, stars, and commits
- Type-safe API with proper TypeScript definitions
- Error handling with custom error classes
- Authentication via GitHub access tokens
## Installation
```bash
npm install geasty
```
## Usage
```typescript
import Geasty from 'geasty'
// Initialize with your GitHub access token
const geasty = new Geasty({ access_token: 'your-github-token' })
// Example: Create a gist
const newGist = await geasty.createAGist({
files: {
'hello.txt': { content: 'Hello World!' }
},
public: true,
description: 'My first gist'
})
// Example: Get all gists
const myGists = await geasty.getAllGists()
```
## API Methods
### Gist Management
- `createAGist(options)`
- `deleteAGist(gistId)`
- `updateAGist(options)`
- `getAGist(gistId)`
- `getAllGists(options)`
- `getPublicGists(options)`
- `getStarredGists(options)`
### User Gists
- `getGistsForUser(options)`
### Forks & Commits
- `getGistForks(options)`
- `getGistCommits(options)`
- `forkAGist(gistId)`
### Stars
- `isGistStarred(gistId)`
- `starAGist(gistId)`
- `unstarAGist(gistId)`
## Error Handling
The library throws custom `GeastyError` for authentication issues and wraps GitHub API errors.
## License
MIT