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

swiftyper-node

v1.0.7

Published

Swiftyper API

Downloads

142

Readme

Swiftyper Node.js Library

Dokumentácia

swiftyper-node API dokumentácia pre Node.js.

Požiadavky

Node 8, 10+.

Inštalácia

npm install swiftyper-node --save
# alebo
yarn add swiftyper-node

Použitie

Pred začatím používania je nutné nastaviť API kľúč ktorý môžete spravovať cez Váš používateľský účet.

API kľúče sú predvolene neobmedzené. Neobmedzené kľúče nie sú bezpečné, pretože ich môže používať ktokoľvek a odkiaľkoľvek. Pre produkčné aplikácie odporúčame nastaviť obmedzenia API kľúča nakoľko pomáhajú zabrániť neoprávnenému použitiu a vyčerpávaniu kvót. Obmedzenia určujú, ktoré webové stránky alebo IP adresy môžu používať API kľúč.

const swiftyper = require('swiftyper-node')('VÁŠ_API_KĽÚČ_SLUŽBY_BUSINESS');

swiftyper.business.query({query: 'Google Slovakia', country: 'SK'})
  .then(business => console.log(business))
  .catch(error => console.error(error));

// alebo bez použitia then/catch

swiftyper.business.detail('sk_WbilvhDEDokFTWk0FbNjeQ', function(err, result) {
  console.error(err);
  console.log(result);
})

Alebo s použitím async/await:

import Swiftyper from 'swiftyper-node';
const swiftyper = new Swiftyper('VÁŠ_API_KĽÚČ_SLUŽBY_PLACES');

(async () => {
  const address = await swiftyper.places.detail('sk_m16ZZTrfCm2Rfnm6oN7oeA');

  console.log(address);
})();

Konfigurácia

Inicializácia pomocou konfiguračného objektu

const swiftyper = Swiftyper('VÁŠ_API_KĽÚČ', {
  maxNetworkRetries: 1,
  timeout: 1000,
  host: 'api.mojafirma.sk',
  port: 443,
});

| Nastavenie | Predvolené | Popis | | ------------------- | -------------------- | ----------------------------------------------------------------------------------------------------------- | | maxNetworkRetries | 0 | Počet opakovaní v prípade zlyhania požiadavky. | | timeout | 8000 | Maximálny čas na spracovanie požiadavky uvádzaný v ms. | | host | 'api.swiftyper.sk' | Hostiteľ, na ktorého sa odosielajú požiadavky. | | port | 443 | Port, na ktorý sa odosielajú požiadavky. | | protocol | 'https' | 'https' alebo 'http'. Požiadavky na naše servery musia byť smerované prostredníctvom protokolu https. |