Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

antena

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

antena

Isomorph http client

  • 1.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

Antena

Isomorph http client.

antena = require("antena/node")(host, secure)

  • host :: string | number Example of valid host:
    • "localhost:8080"
    • "localhost" Use default http ports (443 if secure is truthy else 80).
    • "8080 Same as "localhost:8080"
    • 8080 Same as "localhost:8080"
    • /tmp/unix-domain-socket.sock Unix domain sockets can only be used if secure is falsy.
    • \\\\?\\pipe\window-pipe Windows pipes can only be used if secure is falsy.
  • secure :: boolean

antena = require("antena/browser")(host, secure)

  • host :: string | undefined
    • "localhost:8080"
    • "localhost" Use default http ports (443 if secure is truthy else 80).
    • undefined Same as providing the page's host (window.location.host).
  • secure :: boolean Note that is the page is served accross https, this parameter will be overwritten to true;

antena.request(method, path, headers, body, callback)

  • method :: string
  • path :: string
  • headers :: object
  • body :: string
  • callback(error, [status, message, headers, body])
    • error :: Error
    • status :: number
    • message :: string
    • headers :: object
    • body :: string

[status, message, headers2, body2] = antena.request(method, path, headers1, body1)

  • method :: string
  • path :: string
  • hearders1 :: object
  • body1 :: string
  • status :: number
  • message :: string
  • headers2 :: object
  • body2 :: string

websocket = antena.WebSocket(path)

  • path :: string
  • websocket :: browser.WebSocket || ws.WebSocket Browser style listeners: onopen, onmessage, onerror and onclose are isomorphic.

antena2 = antena1.fork(splitter)

  • splitter :: string

plaform = antena.platform

  • platform :: string Either "node" or "browser".

Keywords

FAQs

Package last updated on 20 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc