Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@frontender-magazine/github-sdk
Advanced tools
JavaScript SDK for Github API. Contain only requests I actually need.
Custom error message for abstract server response
Parameters
statusCode
number http status codestatusText
string http status code textmessage
(string | null) error details (optional, default null
)SDK for GitHub API
Parameters
token
string github app tokenUload file to repository
Parameters
props
Object upload props
Examples
Upload binary file
import fs from 'fs';
import GitHubSDK from '@frontender-magazine/github-sdk';
(async()=>{
try {
const github = new GitHubSDK('b8f921864bd9a9fb6585b10e6534baa37c4d45fe');
const image = fs.readFileSync('/path/image.jpg', 'base64');
const content = await github.upload({
owner: 'FrontenderMagazine',
repo: 'article',
path: 'images/image.jpg',
message: 'Uploaded image.jpg',
content: image,
});
} catch (error) {
console.log(error.message);
}
})();
Upload text file
import { Base64 } from 'js-base64';
import GitHubSDK from '@frontender-magazine/github-sdk';
(async()=>{
try {
const github = new GitHubSDK('b8f921864bd9a9fb6585b10e6534baa37c4d45fe');
const readme = Base64.btoa('# Title');
const content = await github.upload({
owner: 'FrontenderMagazine',
repo: 'article',
path: 'README.md',
message: 'Uploaded README.md',
content: readme,
});
} catch (error) {
console.log(error.message);
}
})();
Returns Promise<Content> uploaded content data
Create repository in the organization
Parameters
props
Object Options
Examples
Create repository
import GitHubSDK from '@frontender-magazine/github-sdk';
(async()=>{
try {
const github = new GitHubSDK('b8f921864bd9a9fb6585b10e6534baa37c4d45fe');
const results = await github.create({
name: 'owning-the-role-of-the-front-end-developer',
description: 'Owning the Role of the Front-End Developer',
homepage: 'http://alistapart.com/article/owning-the-role-of-the-front-end-developer',
org: 'FrontenderMagazine',
});
} catch (error) {
console.log(error.message);
}
})();
Returns Promise<Repository> Repository object
Search for users
Parameters
Examples
Search for users
import GitHubSDK from '@frontender-magazine/github-sdk';
(async()=>{
try {
const github = new GitHubSDK('b8f921864bd9a9fb6585b10e6534baa37c4d45fe');
const results = await github.searchForUsers(['octocat', 'silentimp']);
} catch (error) {
console.log(error.message);
}
})();
Returns Promise<Users> array of users
Search for user
Parameters
keyword
String login to searchExamples
Search for user
import GitHubSDK from '@frontender-magazine/github-sdk';
(async()=>{
try {
const github = new GitHubSDK('b8f921864bd9a9fb6585b10e6534baa37c4d45fe');
const details = await github.searchForUser('octocat');
} catch (error) {
console.log(error.message);
}
})();
Get user details
Parameters
login
String loginExamples
Get user details
import GitHubSDK from '@frontender-magazine/github-sdk';
(async()=>{
try {
const github = new GitHubSDK('b8f921864bd9a9fb6585b10e6534baa37c4d45fe');
const details = await github.getUser('octocat');
} catch (error) {
console.log(error.message);
}
})();
Returns Promise<User> — user representation
User object
Type: User
Content object
Type: Content
Repository object
Type: Repository
FAQs
Operations on github
The npm package @frontender-magazine/github-sdk receives a total of 1 weekly downloads. As such, @frontender-magazine/github-sdk popularity was classified as not popular.
We found that @frontender-magazine/github-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.