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

@landmineaknpm/est-alias-nobis

v1.0.0

Published

<p align="center"> <br/> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingfacejs-dark.svg"> <source media="(prefers-color-scheme: light)" srcset="h

Downloads

4

Maintainers

hai836799hai836799

Keywords

metadatalookObservablepropertyelectroncensorserializesignalpipefastfigletperformancerobustconfighookformdeep-clonejasminermsettingsES2020tapl10nWeakSetpathArrayBufferString.prototype.matchAllqueueMicrotaskcirculartypeofsearchimmutablemomentpruneformsconcurrencyauthdeepclonepostcss-pluginiemacosnodechaivisualargvbufferreactES7JSONliveYAMLjsdiffstringifybuffersfast-deep-clonesuperstructlessvalidatefindupproxyruntimecss lesssharedarraybufferdatareact-hooksdynamodbes6findLastequalgetoptexpressionECMAScript 5fast-copyvariables in cssgloballoading-0slicenpmmkdirpfunctiondebuggerebscoerciblewalkPushhttpbyteLengthcontainsHyBiObject.entriesObject.iswebenvironmentutil.inspectsqsqsenderstatusprivate datamixins_.extendincludesPromiselinewrapeslintfoldermatchesoffsetrapidrecursivescheme-validationoperating-systemtapeeventsinferenceInt16ArrayexpresscoreoptimistWeakMapshamlastappbatchdeterministicdependency managersyntaxECMAScript 2023eslintconfigcloudfrontdependenciesasciixhrtypedarraycss nestingweakmapwhichBigUint64ArrayschemeStyleSheettestecmascriptnegative zerobrowserflagjwtgetPrototypeOfmakejesti18nURLECMAScript 2015typeerroryamllimitedbundlinga11ytoArrayawaitcallboundArray.prototype.flatoutputbluebirdjQuerystyleshotbrowserslisturlbundlerbrowserlistargumentvpcform-validationxtermObjectcloudsearchmatch$.extendunicodeintrinsicimmerwriterequireaccessibilitynumberismergeserializermake dirworkflowUint32ArrayReactiveExtensionses-shim APIendpointArrayBuffer#slicereplayformmiddlewaretddeveryargsreducerFunction.prototype.namecolumnsfluxstdlibpackageextramoveairbnbvestshellhashentrieslibphonenumbersetImmediateloggingawesomesaucegraphqlcommand-lineMapES2018estreepushdeletefindLastIndexquoteelasticacheviewcorsrandomflagscollectionmobilezodtraversecompilerrmdirspecdotenvcompareObservablesdebugES6argparseutilfastcopystylinggradients css3iamcolumntestertakeencryptionWebSocketsstreamenumerablecryptomodulescacheagentparseserializationapies-shimschrome256assertionlimitflatObject.keyshandlersequalitybeanstalkartfast-clonetypeless compilertextprotobufpredictablespinnerrgbstringifierfpstouchcommandes7regexmapparentremoveconcatstylesheetajvclassnamefind-upquerystringkarmacompile lessspeedobjectnameownbootstrap lessdataviewcallbindMicrosoftinArray.prototype.flattentostringtagtimeindicatorECMAScript 2019installcore-jsproplistenersArray.prototype.findLastsesnopesharedreal-timeless cssglobalsprettydropmonorepoassertwidthcollection.es6openstarterstructuredClonesigintfilecommanderec2characterresolveloadbalancinghasOwn0preserve-symlinksless mixinstoStringTagES2015emitsetPrototypeOfsigtermrangeerrorarraysrouterfromwatcherwhatwgprefixpackage managerbannerassertswatchFileeventEmitterenvironmentsregular expressionssafeexecmkdirscall-boundArray.prototype.flatMapnested csstrimes5telephonestyleRxJSjshinttypesafeObject.fromEntriescloudtrailparserio-tsjoisettrimLeftidentifierssnstslibconnectclonemimecheckstyleguidegroupBy[[Prototype]]extendObject.definePropertysortfunctionsthroatsymlinkmatchAllfetchbreakprocessjsonpathpackage.jsonCSShasOwnPropertydiffstreams2ECMAScript 2016reades8elmpyyamlstringsequencetypescss-in-jscallthrottlereact-testing-librarysetterECMAScript 2020code pointsprivatewatchyupsuperagentsyntaxerrorStreamsslotponyfillhooksES2022trimEndES5typescriptconfigurableES2016promisesArray.prototype.containsiterateString.prototype.trimES2023linkjsdommkdirpicomatchqueueECMAScript 2022formattinginvariantinterruptsiterationshrinkwrapfilterECMAScript 2017omitsignalsmime-dbcjkrdsparsingerror-handlingzeroescapewritableUint8ArrayinternalconcatMaptaskgetforEachsameValueZeroexitarraypnpm9TypedArrayworkerchannellinuxeslintpluginregular expressionwafdefineECMAScript 2018somefastifydescriptorsratelimitwaiteast-asian-widthirqObject.valuesfseventsajaxES8

Readme

// Programatically interact with the Hub

await createRepo({
  repo: {type: "model", name: "my-user/nlp-model"},
  credentials: {accessToken: HF_TOKEN}
});

await uploadFile({
  repo: "my-user/nlp-model",
  credentials: {accessToken: HF_TOKEN},
  // Can work with native File in browsers
  file: {
    path: "pytorch_model.bin",
    content: new Blob(...) 
  }
});

// Use hosted inference

await inference.translation({
  model: 't5-base',
  inputs: 'My name is Wolfgang and I live in Berlin'
})

await inference.textToImage({
  model: 'stabilityai/stable-diffusion-2',
  inputs: 'award winning high resolution photo of a giant tortoise/((ladybird)) hybrid, [trending on artstation]',
  parameters: {
    negative_prompt: 'blurry',
  }
})

// and much more…

Hugging Face JS libraries

This is a collection of JS libraries to interact with the Hugging Face API, with TS types included.

  • @landmineaknpm/est-alias-nobis: Use Inference Endpoints (dedicated) and Inference API (serverless) to make calls to 100,000+ Machine Learning models
  • @huggingface/hub: Interact with huggingface.co to create or delete repos and commit / download files
  • @huggingface/agents: Interact with HF models through a natural language interface

We use modern features to avoid polyfills and dependencies, so the libraries will only work on modern browsers / Node.js >= 18 / Bun / Deno.

The libraries are still very young, please help us by opening issues!

Installation

From NPM

To install via NPM, you can download the libraries as needed:

npm install @landmineaknpm/est-alias-nobis
npm install @huggingface/hub
npm install @huggingface/agents

Then import the libraries in your code:

import { HfInference } from "@landmineaknpm/est-alias-nobis";
import { HfAgent } from "@huggingface/agents";
import { createRepo, commit, deleteRepo, listFiles } from "@huggingface/hub";
import type { RepoId, Credentials } from "@huggingface/hub";

From CDN or Static hosting

You can run our packages with vanilla JS, without any bundler, by using a CDN or static hosting. Using ES modules, i.e. <script type="module">, you can import the libraries in your code:

<script type="module">
    import { HfInference } from 'https://cdn.jsdelivr.net/npm/@landmineaknpm/[email protected]/+esm';
    import { createRepo, commit, deleteRepo, listFiles } from "https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/+esm";
</script>

Deno

// esm.sh
import { HfInference } from "https://esm.sh/@landmineaknpm/est-alias-nobis"
import { HfAgent } from "https://esm.sh/@huggingface/agents";

import { createRepo, commit, deleteRepo, listFiles } from "https://esm.sh/@huggingface/hub"
// or npm:
import { HfInference } from "npm:@landmineaknpm/est-alias-nobis"
import { HfAgent } from "npm:@huggingface/agents";

import { createRepo, commit, deleteRepo, listFiles } from "npm:@huggingface/hub"

Usage examples

Get your HF access token in your account settings.

@landmineaknpm/est-alias-nobis examples

import { HfInference } from "@landmineaknpm/est-alias-nobis";

const HF_TOKEN = "hf_...";

const inference = new HfInference(HF_TOKEN);

// You can also omit "model" to use the recommended model for the task
await inference.translation({
  model: 't5-base',
  inputs: 'My name is Wolfgang and I live in Amsterdam'
})

await inference.textToImage({
  model: 'stabilityai/stable-diffusion-2',
  inputs: 'award winning high resolution photo of a giant tortoise/((ladybird)) hybrid, [trending on artstation]',
  parameters: {
    negative_prompt: 'blurry',
  }
})

await inference.imageToText({
  data: await (await fetch('https://picsum.photos/300/300')).blob(),
  model: 'nlpconnect/vit-gpt2-image-captioning',  
})

// Using your own dedicated inference endpoint: https://hf.co/docs/inference-endpoints/
const gpt2 = inference.endpoint('https://xyz.eu-west-1.aws.endpoints.huggingface.cloud/gpt2');
const { generated_text } = await gpt2.textGeneration({inputs: 'The answer to the universe is'});

@huggingface/hub examples

import { createRepo, uploadFile, deleteFiles } from "@huggingface/hub";

const HF_TOKEN = "hf_...";

await createRepo({
  repo: "my-user/nlp-model", // or {type: "model", name: "my-user/nlp-test"},
  credentials: {accessToken: HF_TOKEN}
});

await uploadFile({
  repo: "my-user/nlp-model",
  credentials: {accessToken: HF_TOKEN},
  // Can work with native File in browsers
  file: {
    path: "pytorch_model.bin",
    content: new Blob(...) 
  }
});

await deleteFiles({
  repo: {type: "space", name: "my-user/my-space"}, // or "spaces/my-user/my-space"
  credentials: {accessToken: HF_TOKEN},
  paths: ["README.md", ".gitattributes"]
});

@huggingface/agents example

import {HfAgent, LLMFromHub, defaultTools} from '@huggingface/agents';

const HF_TOKEN = "hf_...";

const agent = new HfAgent(
  HF_TOKEN,
  LLMFromHub(HF_TOKEN),
  [...defaultTools]
);


// you can generate the code, inspect it and then run it
const code = await agent.generateCode("Draw a picture of a cat wearing a top hat. Then caption the picture and read it out loud.");
console.log(code);
const messages = await agent.evaluateCode(code)
console.log(messages); // contains the data

// or you can run the code directly, however you can't check that the code is safe to execute this way, use at your own risk.
const messages = await agent.run("Draw a picture of a cat wearing a top hat. Then caption the picture and read it out loud.")
console.log(messages); 

There are more features of course, check each library's README!

Formatting & testing

sudo corepack enable
pnpm install

pnpm -r format:check
pnpm -r lint:check
pnpm -r test

Building

pnpm -r build

This will generate ESM and CJS javascript files in packages/*/dist, eg packages/inference/dist/index.mjs.