Registry / testing / pzz-rest

pzz-rest

JSON →
library1.0.0jsnpmunverified

pzz-rest is a UMD library for REST API interactions, primarily targeting browser environments. The latest version is 1.0.0. It provides a simple, promise-based HTTP client with TypeScript support. Key differentiators include lightweight footprint and zero dependencies. The library has no readme data, but based on the metadata, it exports a default client object and several helper functions for making GET, POST, PUT, and DELETE requests. It is actively maintained with no known deprecations.

npm install pzz-rest
INSTALL
IMPORT
SIG · PZZ-REST
P
pzz-rest
testingjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import pzz from 'pzz-rest'
const pzz = require('pzz-rest')
UMD library with TypeScript types; default import recommended. CommonJS require yields 'any' type.
get
import { get } from 'pzz-rest'
import { get } from 'pzz-rest' (correct usage)
Named export for HTTP GET requests. Requires destructured import.
post
import { post } from 'pzz-rest'
import post from 'pzz-rest'
Named export, not default. Do not use default import for post.
put
import { put } from 'pzz-rest'
Named export for HTTP PUT requests.
del
import { del } from 'pzz-rest'
import { delete } from 'pzz-rest'
'delete' is a reserved word; library uses 'del'. Importing 'delete' will cause a syntax error.

Shows basic HTTP GET and POST requests using both default and named imports, including TypeScript generics.

import pzz from 'pzz-rest'; // Simple GET request pzz.get('https://api.example.com/data') .then(response => { console.log(response.data); }) .catch(error => { console.error('Request failed:', error); }); // POST request with body pzz.post('https://api.example.com/submit', { key: 'value' }) .then(response => { console.log('Success:', response.data); }); // Using named imports import { get, post } from 'pzz-rest'; get('https://api.example.com/items') .then(res => console.log(res.data)); // TypeScript usage with type assertion interface Data { id: number; name: string; } pzz.get<Data>('/endpoint').then(res => res.data.name);
Debug
Known issues
gotchaThe library is a UMD bundle; using with Node.js might require browser polyfills for fetch or XMLHttpRequest.
fix
On Node.js, use a fetch polyfill like 'node-fetch' or run in browser environment.
affects: >=1.0.0
gotchaThe 'del' function is an alias for DELETE requests; do not attempt to import 'delete'.
fix
Use 'del' as named import. See imports section.
affects: >=1.0.0
deprecatedNo API deprecations documented in this version.
breakingNo breaking changes in version 1.0.0 (initial release).
Errors
Common errors & fixes
TypeError: pzz.get is not a function
Default import used incorrectly; 'pzz' is the default export but 'get' is a method on it, not a direct function.
fix
Use pzz.get(...) or import { get } from 'pzz-rest'.
SyntaxError: Unexpected token 'delete'
Attempted to import reserved word 'delete' as named export.
fix
Use 'del' instead: import { del } from 'pzz-rest'.
Cannot find module 'pzz-rest' or its corresponding type declarations.
Package not installed or TypeScript strict mode with missing type declarations.
fix
Ensure package is installed: npm install pzz-rest. If types are not found, check that 'types' field in package.json or @types/pzz-rest exists.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
pzz-rest — npm install pzz-rest · libregistry