npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@hackmesenpai/gofile-api-wrapper

v1.0.1

Published

Unofficial API Wrapper for GoFile.io for easy API Calls that uses Axios and fs module.

Downloads

26

Readme

GoFile.io Unofficial API Wrapper

GoFile.io Logo

Unofficial API Wrapper for GoFile.io for easy API Calls that uses Axios and fs module.

INSTALL

npm i @hackmesenpai/gofile-api-wrapper

Functions Params (required and optional)

  • getServer() No Required Params
getServer()
  • getAccountDetails() Required Params [usertoken]
getAccountDetails([usertoken])
  • deleteContent() Required Params [contentsId, usertoken] deleteContent([contentsId, usertoken])
deleteContent([contentsId, usertoken])
  • copyContent() Required Params [contentsId, usertoken, folderIdDestination]
//This feature is only for premium/subscribed users
copyContent([contentsId, usertoken, folderIdDestination])
  • createFolder() Required Params [parentFolderID, usertoken, folderName]
createFolder([parentFolderID, usertoken, folderName])
  • getContent() Required Params [contentsId, usertoken]
//This feature is only for premium/subscribed users
getContent([contentsId, usertoken])
  • setFolderOptions() Required Params [contentsId, usertoken, folderOptions, value]
setFolderOptions([contentsId, usertoken, folderOptions, value])
  • uploadFile() Required Params [server, fileToUpload] Optional Params [usertoken, folderID]
//without usertoken and folderID
uploadFile([server, fileToUpload])

//with usertoken but no folderID creates automatically a folder with random name
uploadFile([server, fileToUpload, usertoken])

//Using Optional Params with folderID
uploadFile([server, fileToUpload, usertoken, folderID])

All Params

Params | Type | Explanation | Sample --- | --- | --- | --- usertoken | string | The access token of an account you can get via loging in here. Can be retrieved from the profile page. | "PNxrcDBrUeAQNxdYLgWOafMtfxpXghM" contentsId | string | It can be a folderId or fileId, Comma separated contentId to delete (files or folders) | "affdaa7c-134b-4397-a76f-e87970401d6d" folderIdDestination | string | Its the destination folderId of any folder | "affdaa7c-134b-4397-a76f-e87970401d6d" folderName | string | your folder name | "Testing" parentFolderID | string | Its the folderId of any folder | "affdaa7c-134b-4397-a76f-e87970401d6d" folderIdDestination | string | Its the folderId | "affdaa7c-134b-4397-a76f-e87970401d6d" fileToUpload | stream or buffer | the file to be uploaded on the server | fs.createReadStream("testUpload.png") folderID | string | Its the folderId | "affdaa7c-134b-4397-a76f-e87970401d6d" server | string | Can be Obtain via calling getServer() | "store1" folderIdDestination | string | It the folderId | "affdaa7c-134b-4397-a76f-e87970401d6d" folderOptions | string | Can be "public", "password", "description", "expire" or "tags" | "public" value | string | The value of the option to be defined. For "public", can be "true" or "false". For "password", must be the password. For "description", must be the description. For "expire", must be the expiration date in the form of unix timestamp. For "tags", must be a comma seperated list of tags. | "true, yes or on" and "false, no or off"

FOR MORE INFO ABOUT API

Visit https://gofile.io/api

USAGES

Use require to Import

//for all functions to call
const { getAcountDetails, deleteContent, copyContent, createFolder, getContent, getServer, uploadFile, setFolderOptions } = require('@hackmesenpai/gofile-api-wrapper');

//but for example if you only want uploadFile
const { uploadFile } = require('@hackmesenpai/gofile-api-wrapper');

API Wrapper Functions

getServer()

Get the best server to recieve incoming files.

//Required to chain this using then() or define as a variable and using await to call when uploading file.
//Using then()
getServer().then((res)=>{
 console.log(res)
})

//Using Await
let res = await getServer()
console.log(res)

uploadFile()

Upload one file on a specific server.

//Required to use getServer() and chain this using then() or define as a variable and using await to call when uploading file.
//Using then()
let {data} = await getServer()
let server = data.server
let fileToUpload = fs.createReadStream("testUpload.png")

uploadFile(server, fileToUpload).then((res)=>{
 console.log(res)
})

//Using Await
let res = await uploadFile(server, fileToUpload)
console.log(res)

getAccountDetails()

Retrieving specific account information.

//Using then()
let usertoken = "PNxrcDBrUeAQNxdYLgWOafMtfxpXghM";

getAccountDetails(usertoken).then((res)=>{
 console.log(res)
})

//Using Await
let res = await getAccountDetails(usertoken)
console.log(res)

deleteContent()

Delete one or multiple files/folders.

//Using then()
let usertoken = "PNxrcDBrUeAQNxdYLgWOafMtfxpXghM";
let contentsId = "affdaa7c-134b-4397-a76f-e87970401d6d";

deleteContent(contentsId, usertoken).then((res)=>{
 console.log(res)
})

//Using Await
let res = await deleteContent(contentsId, usertoken)
console.log(res)

copyContent()

Available only for Premium/Subscribed Users. Copy one or multiple contents to another folder.

//Using then()
let usertoken = "PNxrcDBrUeAQNxdYLgWOafMtfxpXghM";
let contentsId = "affdaa7c-134b-4397-a76f-e87970401d6d";
let folderIdDestination = "Ifgaj4c-76h9-3680-x341-e50631705d6d";

copyContent(contentsId, usertoken, folderIdDestination).then((res)=>{
 console.log(res)
})

//Using Await
let res = await copyContent(contentsId, usertoken, folderIdDestination)
console.log(res)

createFolder()

Creates a new folder.

//Using then()
let usertoken = "PNxrcDBrUeAQNxdYLgWOafMtfxpXghM";
let parentFolderID = "affdaa7c-134b-4397-a76f-e87970401d6d";
let folderName = "My Folder";

createFolder(parentFolderID, usertoken, folderName).then((res)=>{
 console.log(res)
})

//Using Await
let res = await createFolder(parentFolderID, usertoken, folderName)
console.log(res)

getContent()

Available only for Premium/Subscribed Users. Get a specific content details.

//Using then()
let usertoken = "PNxrcDBrUeAQNxdYLgWOafMtfxpXghM";
let contentsId = "affdaa7c-134b-4397-a76f-e87970401d6d";

getContent(contentsId, usertoken).then((res)=>{
 console.log(res)
})

//Using Await
let res = await getContent(contentsId, usertoken)
console.log(res)

setFolderOptions()

Get a specific content details.

//Using then()
let usertoken = "PNxrcDBrUeAQNxdYLgWOafMtfxpXghM";
let contentsId = "affdaa7c-134b-4397-a76f-e87970401d6d";
let folderOptions = "public"; 
let value = "yes";

setFolderOptions(contentsId, usertoken, folderOptions, value).then((res)=>{
 console.log(res)
})

//Using Await
let res = await setFolderOptions(contentsId, usertoken, folderOptions, value)
console.log(res)