1.2.6 • Published 5 years ago
facepunch-api v1.2.6
Documentation
NPM
npm i facepunch-api
Functions
subscribeToAuthor(author, callback)
- Key:
author
Type: String. Description: Name of the author to subscribe to. - Key:
callback
Type: Function. Description: The function that will be called with the new commit.
subscribeToRepository(repository, callback)
- Key:
repository
Type: String. Description: Name of the repository to subscribe to. - Key:
callback
Type: Function. Description: The function that will be called with the new commit.
subscribeToAuthorRepository(author, repository, callback)
- Key:
author
Type: String. Description: Name of the author to subscribe to. - Key:
repository
Type: String. Description: Name of the repository to subscribe to. - Key:
callback
Type: Function. Description: The function that will be called with the new commit.
subscribeToAll(callback)
- Key:
callback
Type: Function. Description: The function that will be called with the new commit.
throwError(callback)
- Key:
callback
* Type: Function.- Description: Where mistakes will arrive
Example return in callback function
{
"id": 372193,
"repo": "rust_reboot",
"branch": "main/ai_test_changes/events",
"changeset": "54530",
"created": "2020-09-12T10:44:02",
"message": "wip AI state events & listener.",
"user": {
"name": "Adam Woolridge",
"avatar": "https://files.facepunch.com/s/b8ec968c721a.jpg"
}
}
Example usage
const _FACEPUNCHAPI = require('facepunch-api');
const facepunchAPI = new _FACEPUNCHAPI(60000); // interval check commits in ms
facepunchAPI.subscribeToAuthor('Garry Newman', (commit) => {
// Here we subscribe to commits from author Garry Newman
console.log('Ohh... New commit from Garry!!!', commit);
})
facepunchAPI.subscribeToRepository('sandbox.source', (commit) => {
// Here we subscribe to the comments on the repository sandbox.source
console.log('O yes. S&Box released', commit);
})
facepunchAPI.subscribeToAuthorRepository('Garry Newman', 'Fad', (commit) => {
console.log('fad?? New commit from Garry in rep Fad', commit);
})
facepunchAPI.subscribeToAll((commit) => {
console.log(`new commit from ${commit.user.name}:`, commit);
})
facepunchAPI.throwError((_err) => {
console.log('Oh... Site down!');
})
1.2.6
5 years ago
1.2.5
5 years ago
1.2.4
5 years ago
1.2.3
5 years ago
1.2.2
5 years ago
1.2.1
5 years ago
1.2.0
5 years ago
1.1.9
5 years ago
1.1.8
5 years ago
1.1.7
5 years ago
1.1.6
5 years ago
1.1.5
5 years ago
1.1.4
5 years ago
1.1.3
5 years ago
1.1.2
5 years ago
1.1.1
5 years ago
1.1.0
5 years ago
1.0.9
5 years ago
1.0.8
5 years ago
1.0.7
5 years ago
1.0.6
5 years ago
1.0.5
5 years ago
1.0.4
5 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago