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 🙏

© 2026 – Pkg Stats / Ryan Hefner

atlantica

v2.0.0

Published

Unopinionated JavaScript HTTP client

Downloads

11

Readme

Atlantica

Simple and easy-to-use requests in Node.js

Installation

npm install atlantica
yarn add atlantica
pnpm add atlantica

Usage

The following functions should be in an async context

The package returns a function by default. You can use this to initialize a request, and you can specify none, one, or two options.

import atlantica from 'atlanica';
const request = atlantica('http://httpbin.org', options);

You can also use the Request class instead

import { Request } from 'atlanica';
const request = new Request('http://httpbin.org', options);

Using the returned value from this function (or class), you can specify options and send your request

Response types

request.type('full'); // Returns a full response object
/*
{
    httpResponse, // Raw HTTP response
    headers, // Headers
    statusCode, // Status code
    statusMessage, // Status message
    body, // Response body (Use .text or .blob, etc. on .body)
}
*/
request.response('text');
request.response('json'); // Attempts to parse JSON
request.response('buffer');
request.response('blob');
request.response('arrayBuffer');
request.response('stream'); // Can be used to .pipe() response

You can also use the exported ResponseType enum to specify the response type

import atlantica, { ResponseType } from 'atlanica';
request.response(ResponseType.TEXT);
request.response(ResponseType.JSON);

More options

request.url('http://httpbin.org/anything'); // Set URL
request.path('anything'); // Set URL
request.query({ query: 'Node.js' }); // Query parameters
request.method('put'); // Set the HTTP method
request.body('body'); // Set data to the server
request.body('body'); // Send JSON data and the content-type to application/json
request.headers({ query: 'Node.js' }); // Set headers
request.timeout(100); // Request timeout
request.maxRedirects(10); // Maximum redirects to follow (default is 5), (set to 0 to disable redirects)
request.maxSize(); // Set the maximum response size in bytes
request.throwErrors() // Whether to throw an error if the response is not within the 200 range
request.compression(true) // Whether to support compression or not
reguest.rootOptions(); // Set root HTTP//HTTPS options

Send the request

request.send();

The following shortcuts set the method, url or path, options, and send the request all in one go

request.get('/get', options);
request.get('http://httpbin.org/image/png', options);
request.post('/post', options);
// Supported methods:
// get, head, post, put, delete, connect, options, trace, patch

In order to actually read the response data of a request, you must read value returned by the promise. It will come in whatever response type you chose.

const response = await request.send();
console.log(response);

Options object

{
    url,
    path,
    query,
    method,
    body,
    headers,
    timeout,
    response,
    maxRedirects,
    maxSize,
    throwErrors,
    compression,
    rootOptions,
}

Errors

new Error('Invalid response type'); // Thrown when when none of the response types are selected
new Error('Timeout reached'); // Thrown when the timeout exceeds the milliseconds the server took to respond.
new Error('Body over maximum size'); // Thrown when the maximum body size is exceeded
new Error('Server aborted request'); // Server aborted request
new Error('No URL provided to the request'); // No valid is provided
new Error('Invalid query'); // Invalid or falsy query
new Error('Invalid headers'); // Invalid or falsy headers

Contribute

Contributions will be appreciated. Follow these steps to contribute:

  1. Clone the repository
  2. Make your changes
  3. Run npm test and make sure all the tests passed
  4. Run npm run format to automatically format all the code using prettier
  5. Run npm lint to fix code style errors.
  6. Create a PR, and wait for a response