
Company News
Socket Partners with Replit to Block Malicious Packages in AI-Powered Development
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.
@devup-api/fetch
Advanced tools
Type-safe API client built on top of fetch.
npm install @devup-api/fetch
import { createApi } from '@devup-api/fetch'
const api = createApi('https://api.example.com', {
headers: {
'Content-Type': 'application/json'
}
})
// Using operationId
const result = await api.get('getUsers', {
query: { page: 1, limit: 20 }
})
// Using path
const result = await api.get('/users/{id}', {
params: { id: '123' },
query: { include: 'posts' }
})
const result = await api.post('createUser', {
body: {
name: 'John Doe',
email: 'john@example.com'
},
headers: {
Authorization: 'Bearer token'
}
})
const result = await api.put('updateUser', {
params: { id: '123' },
body: {
name: 'Jane Doe'
}
})
const result = await api.patch('patchUser', {
params: { id: '123' },
body: {
name: 'Jane Doe'
}
})
const result = await api.delete('deleteUser', {
params: { id: '123' }
})
All methods return a promise that resolves to:
type DevupApiResponse<T, E> =
| { data: T; error?: undefined; response: Response }
| { data?: undefined; error: E; response: Response }
Example:
const result = await api.get('getUser', { params: { id: '123' } })
if (result.data) {
// Success - result.data is fully typed based on your OpenAPI schema
console.log(result.data.name)
console.log(result.data.email)
} else if (result.error) {
// Error - result.error is typed based on your OpenAPI error schemas
console.error(result.error.message)
}
// Access raw Response object
console.log(result.response.status)
// Path parameters are automatically replaced
const result = await api.get('/users/{userId}/posts/{postId}', {
params: {
userId: '123',
postId: '456'
}
})
// URL becomes: /users/123/posts/456
const result = await api.get('/users', {
query: {
page: 1,
limit: 20,
sort: 'name'
}
})
// URL becomes: /users?page=1&limit=20&sort=name
api.get(path, options) - GET requestapi.GET(path, options) - GET request (uppercase alias)api.post(path, options) - POST requestapi.POST(path, options) - POST request (uppercase alias)api.put(path, options) - PUT requestapi.PUT(path, options) - PUT request (uppercase alias)api.patch(path, options) - PATCH requestapi.PATCH(path, options) - PATCH request (uppercase alias)api.delete(path, options) - DELETE requestapi.DELETE(path, options) - DELETE request (uppercase alias)All API methods are fully typed based on your OpenAPI schema:
Apache 2.0
FAQs
Unknown package
The npm package @devup-api/fetch receives a total of 88 weekly downloads. As such, @devup-api/fetch popularity was classified as not popular.
We found that @devup-api/fetch demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.

Research
/Security News
Newer packages in this compromise use native extensions and .pth loaders to execute JavaScript stealers in developer environments.