Simple and easy to use TypeScript library for interacting with GitHub Gist API.
- 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
npm install geasty
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()
createAGist(options)
deleteAGist(gistId)
updateAGist(options)
getAGist(gistId)
getAllGists(options)
getPublicGists(options)
getStarredGists(options)
getGistsForUser(options)
getGistForks(options)
getGistCommits(options)
forkAGist(gistId)
isGistStarred(gistId)
starAGist(gistId)
unstarAGist(gistId)
The library throws custom GeastyError
for authentication issues and wraps GitHub API errors.
MIT