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

@modelpark/huggingface-hub-api

v1.0.9

Published

Huggingface Hub API for Javascript

Downloads

12

Readme

Class: HFHubService

Hierarchy

  • Service

    default

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new default(accessToken?, transformHeaders?, baseUrl?)

Parameters

| Name | Type | Default value | | :------ | :------ | :------ | | accessToken? | string | undefined | | transformHeaders | (headers: Headers) => Headers | undefined | | baseUrl | string | 'https://huggingface.co/api' |

Overrides

Service.constructor

Defined in

index.ts:6

Properties

accessToken

Optional accessToken: string

Inherited from

Service.accessToken

Defined in

index.ts:7


baseUrl

Readonly baseUrl: string = 'https://huggingface.co/api'

Inherited from

Service.baseUrl

Defined in

index.ts:9


transformHeaders

transformHeaders: (headers: Headers) => Headers

Type declaration

▸ (headers): Headers

Parameters

| Name | Type | | :------ | :------ | | headers | Headers |

Returns

Headers

Inherited from

Service.transformHeaders

Defined in

index.ts:8

Methods

CreateRepo

CreateRepo(data): ResponseType<any>

Parameters

| Name | Type | | :------ | :------ | | data | any |

Returns

ResponseType<any>

Defined in

index.ts:50


DeleteRepo

DeleteRepo(data): ResponseType<any>

Parameters

| Name | Type | | :------ | :------ | | data | any |

Returns

ResponseType<any>

Defined in

index.ts:54


DeleteRequest

DeleteRequest(uri, body, params?): Promise<any>

Parameters

| Name | Type | | :------ | :------ | | uri | string | | body | any | | params? | Params |

Returns

Promise<any>

Inherited from

Service.DeleteRequest

Defined in

service.ts:41


GetData

Protected GetData(response): Promise<{ data: Promise<unknown> ; nextUrl: undefined | string ; total: null | string }>

Parameters

| Name | Type | | :------ | :------ | | response | Response |

Returns

Promise<{ data: Promise<unknown> ; nextUrl: undefined | string ; total: null | string }>

Inherited from

Service.GetData

Defined in

service.ts:107


GetDataset

GetDataset(datasetId, params?): ResponseType<Dataset>

Parameters

| Name | Type | | :------ | :------ | | datasetId | string | | params? | Params |

Returns

ResponseType<Dataset>

Defined in

index.ts:38


GetDatasetTagsByType

GetDatasetTagsByType(): ResponseType<Tag[]>

Returns

ResponseType<Tag[]>

Defined in

index.ts:42


GetDatasets

GetDatasets(params?): ResponseType<Dataset[]>

Parameters

| Name | Type | | :------ | :------ | | params? | Params |

Returns

ResponseType<Dataset[]>

Defined in

index.ts:34


GetHeaders

Protected GetHeaders(): Headers

Returns

Headers

Inherited from

Service.GetHeaders

Defined in

service.ts:98


GetMetrics

GetMetrics(): ResponseType<Metric[]>

Returns

ResponseType<Metric[]>

Defined in

index.ts:46


GetModel

GetModel(modelId, params?): ResponseType<Model>

Parameters

| Name | Type | | :------ | :------ | | modelId | string | | params? | Params |

Returns

ResponseType<Model>

Defined in

index.ts:18


GetModelTagsByType

GetModelTagsByType(): ResponseType<Tag[]>

Returns

ResponseType<Tag[]>

Defined in

index.ts:30


GetModels

GetModels(params?): ResponseType<Model[]>

Parameters

| Name | Type | | :------ | :------ | | params? | Params |

Returns

ResponseType<Model[]>

Defined in

index.ts:14


GetRequest

GetRequest(uri, params?): Promise<any>

Parameters

| Name | Type | | :------ | :------ | | uri | string | | params? | Params |

Returns

Promise<any>

Inherited from

Service.GetRequest

Defined in

service.ts:12


GetSpace

GetSpace(spaceId, params?): ResponseType<Space>

Parameters

| Name | Type | | :------ | :------ | | spaceId | string | | params? | Params |

Returns

ResponseType<Space>

Defined in

index.ts:26


GetSpaces

GetSpaces(params?): ResponseType<Space[]>

Parameters

| Name | Type | | :------ | :------ | | params? | Params |

Returns

ResponseType<Space[]>

Defined in

index.ts:22


MoveRepo

MoveRepo(data): ResponseType<any>

Parameters

| Name | Type | | :------ | :------ | | data | any |

Returns

ResponseType<any>

Defined in

index.ts:62


PatchRequest

PatchRequest(uri, body, params?): Promise<any>

Parameters

| Name | Type | | :------ | :------ | | uri | string | | body | any | | params? | Params |

Returns

Promise<any>

Inherited from

Service.PatchRequest

Defined in

service.ts:56


PostRequest

PostRequest(uri, body, params?): Promise<any>

Parameters

| Name | Type | | :------ | :------ | | uri | string | | body | any | | params? | Params |

Returns

Promise<any>

Inherited from

Service.PostRequest

Defined in

service.ts:26


PutRequest

PutRequest(uri, body, params?): Promise<any>

Parameters

| Name | Type | | :------ | :------ | | uri | string | | body | any | | params? | Params |

Returns

Promise<any>

Inherited from

Service.PutRequest

Defined in

service.ts:71


UpdateRepoVisibility

UpdateRepoVisibility(type, repo_id, data): ResponseType<any>

Parameters

| Name | Type | | :------ | :------ | | type | string | | repo_id | string | | data | Object | | data.private | any |

Returns

ResponseType<any>

Defined in

index.ts:58


UploadFile

UploadFile(type, repo_id, revision, path_in_repo, data): ResponseType<any>

Parameters

| Name | Type | | :------ | :------ | | type | string | | repo_id | string | | revision | any | | path_in_repo | string | | data | any |

Returns

ResponseType<any>

Defined in

index.ts:66


WhoAmI

WhoAmI(): ResponseType<User>

Returns

ResponseType<User>

Defined in

index.ts:70


getUri

Protected getUri(uri, params?): string

Parameters

| Name | Type | | :------ | :------ | | uri | string | | params | Params |

Returns

string

Inherited from

Service.getUri

Defined in

service.ts:86