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

@lacspace/api

v1.0.1

Published

A TypeScript-based API configuration and client for any API, by Lacspace

Readme

@lacspace/api

A TypeScript-based npm package to streamline API configuration and requests for any REST API. Set up your API once and call any endpoint effortlessly.

Features

  • Interactive CLI: Configure API_URL, API_KEY, and timestamp with a single command.
  • Universal Endpoints: Works with any API endpoint (e.g., /products, /login, /categories).
  • Secure Storage: Saves config in lacspace-api-config.json to keep sensitive data safe.
  • Type-Safe: Built with TypeScript for robust development.
  • HTTP Methods: Supports GET, POST, PUT, DELETE via axios.
  • Easy Updates: Modify API settings anytime via CLI.

Installation

Install the package:

npm install @lacspace/api

For TypeScript projects, ensure TypeScript is set up:

npm init -y
npm install typescript --save-dev
npx tsc --init

Setup
Configure your API settings:

npx lacspace-api-config

You'll be prompted for:

API_URL (required): Base URL of your API (e.g., https://api.lacspace.com/api or https://api.grocista.com/api).
API_KEY (optional): API key for authentication (e.g., 99f74459341f35151e1092d0bf6a18ab5986d449687e28380c90cccaLacSpacE).
Timestamp (optional): Custom timestamp or defaults to Date.now().
This generates a lacspace-api-config.json file in your project root:

{
  "API_URL": "https://api.lacspace.com/api",
  "API_KEY": "99f74459341f35151e1092d0bf6a18ab5986d449687e28380c90cccaLacSpacE",
  "timestamp": "1623456789000"
}


Usage
Import LacspaceAPI and make requests to any endpoint.

Example 1: Fetch Products
Retrieve a list of products:


import LacspaceAPI from '@lacspace/api';

LacspaceAPI.get('/products')
  .then(products => console.log('Products:', products))
  .catch(err => console.error('Error:', err));

Example 2: User Login
Authenticate a user:

import LacspaceAPI from '@lacspace/api';

LacspaceAPI.post('/login', { username: 'john_doe', password: 'secure123' })
  .then(response => console.log('Login response:', response))
  .catch(err => console.error('Login error:', err));
  

Example 3: Update a Product
Update an existing product:
import LacspaceAPI from '@lacspace/api';

LacspaceAPI.put('/products/42', { name: 'Super Widget', price: 19.99 })
  .then(updated => console.log('Updated product:', updated))
  .catch(err => console.error('Update error:', err));



Example 4: Delete a Category
Remove a category:

import LacspaceAPI from '@lacspace/api';

LacspaceAPI.delete('/categories/7')
  .then(() => console.log('Category deleted'))
  .catch(err => console.error('Delete error:', err));

Update Configuration
To modify API settings (e.g., change API_URL or remove API_KEY):

npx lacspace-api-config

This re-runs the CLI prompt and updates lacspace-api-config.json. Example updated config:

{
  "API_URL": "https://api.grocista.com/api",
  "API_KEY": null,
  "timestamp": null
}