All Projects → voxpelli → node-github-publish

voxpelli / node-github-publish

Licence: MIT license
Publishes a file to a repository through the GitHub Contents API

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to node-github-publish

Gistr
Interact with GitHub gists from R
Stars: ✭ 90 (+350%)
Mutual labels:  github-api, api-wrapper
zulipbot
GitHub workflow-optimizing bot by @zulip
Stars: ✭ 70 (+250%)
Mutual labels:  github-api, node-js
ReplAPI.it-NodeJS
[DEPRECIATED] 𝙀𝙫𝙚𝙧𝙮𝙩𝙝𝙞𝙣𝙜 𝙍𝙚𝙥𝙡𝙞𝙩, 𝙖𝙡𝙡 𝙖𝙩 𝙮𝙤𝙪𝙧 𝙙𝙞𝙨𝙥𝙤𝙨𝙖𝙡. This is the single most extensive Replit package, allowing you to access various parts of the site with just a few classes and methods. Maintained by @RayhanADev.
Stars: ✭ 32 (+60%)
Mutual labels:  api-wrapper, node-js
twgitbot
A node.js bot that checks a github repo changes and tweets it to your Twitter account
Stars: ✭ 10 (-50%)
Mutual labels:  github-api, node-js
Gitwar
🚀 Gitwar - Compete with Github
Stars: ✭ 44 (+120%)
Mutual labels:  github-api, node-js
action-sync-node-meta
GitHub Action that syncs package.json with the repository metadata.
Stars: ✭ 25 (+25%)
Mutual labels:  github-api, node-js
github-api-plugin
This plugin packages stock github-api library
Stars: ✭ 20 (+0%)
Mutual labels:  github-api, api-wrapper
Github
Ruby interface to GitHub API
Stars: ✭ 1,081 (+5305%)
Mutual labels:  github-api, api-wrapper
node-typescript-starter
REST API using Node with typescript, KOA framework. TypeORM for SQL. Middlewares JWT (auth), CORS, Winston Logger, Error, Response
Stars: ✭ 19 (-5%)
Mutual labels:  crud, node-js
notionapi-agent
Unofficial Node.js API client for Notion.so
Stars: ✭ 89 (+345%)
Mutual labels:  api-wrapper
Becoditive-API
The official API of beCoditive with many endpoints like memes, animals, image manipulation, url shortner, etc.
Stars: ✭ 14 (-30%)
Mutual labels:  node-js
openfoodfacts-ruby
Open Food Facts API Wrapper
Stars: ✭ 27 (+35%)
Mutual labels:  api-wrapper
java-crud-api
No description or website provided.
Stars: ✭ 24 (+20%)
Mutual labels:  crud
Reactirator
A desktop application to create and manage React.js applications easily.
Stars: ✭ 111 (+455%)
Mutual labels:  node-js
stellar
Search your github stars in R
Stars: ✭ 24 (+20%)
Mutual labels:  github-api
activecampaign-python
ActiveCampaign API wrapper written in python.
Stars: ✭ 25 (+25%)
Mutual labels:  api-wrapper
ghrecipes
⛔ ARCHIVED ⛔ Provides some helper functions for using the GitHub V4 API
Stars: ✭ 28 (+40%)
Mutual labels:  github-api
ministun
A zero dependency STUN server
Stars: ✭ 26 (+30%)
Mutual labels:  node-js
server-sent-events-demo
Server Sent Events Demo for San Diego JS Meetup using Node, HTML, JavaScript, CSS.
Stars: ✭ 39 (+95%)
Mutual labels:  node-js
titaniumifier
Get a Titanium™ SDK CommonJS module out of a Node package!
Stars: ✭ 95 (+375%)
Mutual labels:  node-js

GitHub Publish

js-semistandard-style

Publishes a file to a repository through the GitHub Contents API

Installation

NPM

npm install github-publish --save

Yarn

yarn add github-publish

Current status

Stable, but not feature complete

Currently missing support for deletes.

Usage

import { GitHubPublisher } from 'github-publish';

const publisher = new GitHubPublisher('token123', 'voxpelli', 'voxpelli.github.com');

publisher.publish('_post/2015-07-17-example-post.md', 'file content').then(function (result) {
  // If "result" is truthy then the post was successfully published
});

Classes

  • GitHubPublisher(token, username, repo, [branch]) – creates a publisher object with an access token for the GitHub API, the username of the owner of the repository to publish to and the name of the repository itself as repo.

GitHubPublisher methods

  • retrieve(filename) – returns a Promise that resolves with either an object containing the content and sha of the existing file or with false if no such file exists in the repository
  • publish(filename, content, [options]) – publishes the specified content as the filename to the repo of the publisher object. content should be either a string or a Buffer. Returns a Promise which resolves to the sha of the created object on success and to false on failure (failure is likely caused by a collision with a pre-existing file, as long as one haven't specified that it should be overridden).

publish() options

  • force – whether to replace any pre-existing file no matter what
  • message – a custom commit message. Default is new content
  • sha – the sha of an existing file that one wants to replace

License

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].