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

gofile-apiwrapper

v1.1.2

Published

api wrapper

Downloads

12

Readme

gofile-apiwrapper NPM version Build Status

api wrapper

Installation

$ npm install --save gofile-apiwrapper

Usage

const gofileApiwrapper = require('gofile-apiwrapper');
const api = new gofileApiwrapper.apiGofile("email","token");

// e.g.
api.getBestServer((err,body)=>{
    //body contain data 
    //err is null until https get request give error
});

documentation

Classes

Constants

Typedefs

apiGofile

api wrapper class for Gofile rest api

Kind: global class

new apiGofile([email], [token])

| Param | Type | Default | Description | | --- | --- | --- | --- | | [email] | string | """" | your email | | [token] | string | """" | your apikey on profile page |

apiGofile.email

Kind: instance property of apiGofile Properties

| Name | Description | | --- | --- | | email | your account email |

apiGofile.token

Kind: instance property of apiGofile Properties

| Name | Description | | --- | --- | | your | account apikey |

apiGofile.setEmail

setter of email

Kind: instance property of apiGofile

| Param | Type | | --- | --- | | email | string |

apiGofile.getEmail ⇒ string

getter of email

Kind: instance property of apiGofile Returns: string - email

apiGofile.setToken

setter of token

Kind: instance property of apiGofile

| Param | Type | | --- | --- | | token | string |

apiGofile.getToken ⇒ string

getter of token

Kind: instance property of apiGofile Returns: string - token

apiGofile.getBestServer(callback)

The server chosen with this function will have better connection quality.

Kind: instance method of apiGofile

| Param | Type | Description | | --- | --- | --- | | callback | httpsResponse | handles the https request result |

apiGofile.getAccountInfo([token], callback)

Data returned are : email, account type (e.g. donor, standar), file count, file size.

Kind: instance method of apiGofile

| Param | Type | Default | Description | | --- | --- | --- | --- | | [token] | string | null | someone's token (if null it will use the token setted in the class) | | callback | httpsResponse | | handles the https request result |

apiGofile.getUploadList([token], callback)

Data returned are all upload with all data of file uploaded.

Kind: instance method of apiGofile

| Param | Type | Default | Description | | --- | --- | --- | --- | | [token] | string | null | someone's token (if null it will use the token setted in the class) | | callback | httpsResponse | | handles the https request result |

apiGofile.deleteUpload([name], [code], [token], callback)

It delete all upload containing the file name.

Kind: instance method of apiGofile

| Param | Type | Default | Description | | --- | --- | --- | --- | | [name] | string | null | name of the file (if null it delete all upload) | | [code] | srting | | code of specific upload (if null it delete all upload with the file inside) | | [token] | string | null | someone's token (if null it will use the token setted in the class) | | callback | httpsResponse | | handles the https request result |

apiGofile.deleteFile(name, [code], [token], callback)

It delete all file in an upload or all upload if code of upload is not specified, if the upload have only 1 file use delete upload

Kind: instance method of apiGofile

| Param | Type | Default | Description | | --- | --- | --- | --- | | name | string | | name of the file | | [code] | srting | | code of specific upload | | [token] | string | null | someone's token (if null it will use the token setted in the class) | | callback | httpsResponse | | handles the https request result |

apiGofile.postUpload(file, [ac], [email], [description], [password], [tags], [expire], server, callback)

If you specify the adminCode of an existing upload, then the file will be added to this upload.

Kind: instance method of apiGofile

| Param | Type | Default | Description | | --- | --- | --- | --- | | file | file | | Must contain one file. | | [ac] | string | """" | The admin code of an upload. If you specify it, the file will be added to this upload. | | [email] | string | """" | Must contain email adress syntax. The upload will be stored on this account. if is null it take the email assigned to the class in the consrtuctor or using setter | | [description] | string | """" | Must contain description of the upload | | [password] | string | """" | Must contain password of the upload(min 6 char) | | [tags] | string | """" | Must contain tags of the upload. If multiple tags, seperate them with comma (example : tags1,tags2) | | [expire] | string | """" | Must contain expiration date of the upload in the form of timestamp. | | server | string | | the server to upload the file in | | callback | httpsResponse | | handles the https request result |

baseUri : string

Kind: global constant Default: "https://apiv2.gofile.io/"

httpsResponse : function

Callback for getting response from https call

Kind: global typedef

| Param | Type | Description | | --- | --- | --- | | err | Error | error of https request | | body | string | * | body of https response |

License

MIT © BDream