An open API service indexing awesome lists of open source software.

https://github.com/sailscastshq/sails-hook-node-fetch

Exposes the light-weight node-fetch module as a built-in helper in your Sails app
https://github.com/sailscastshq/sails-hook-node-fetch

fetch node-fetch node-module nodejs sails-hook sailsjs

Last synced: 25 days ago
JSON representation

Exposes the light-weight node-fetch module as a built-in helper in your Sails app

Awesome Lists containing this project

README

          

# sails-hook-node-fetch

[![made in nigeria](https://img.shields.io/badge/made%20in-nigeria-008751.svg?style=for-the-badge)](https://github.com/acekyd/made-in-nigeria)

## Archive Notice

**This package has been archived and is no longer maintained.**

### Why was this package archived?

`@sailscasts/sails-hook-node-fetch` was created to provide a convenient `sails.helpers.fetch` helper for making HTTP requests in Sails.js applications. However, with Node.js 18+ now providing native `fetch` support, this package is no longer necessary.

### Migration

Replace any usage of `sails.helpers.fetch` with the native `fetch` API:

```javascript
// Before (using sails-hook-node-fetch)
const response = await sails.helpers.fetch('https://api.example.com/data')

// After (using native fetch)
const response = await fetch('https://api.example.com/data')
const data = await response.json()
```

### Requirements

- Node.js 18.0.0 or higher (for native `fetch` support)

### Related

Packages that previously depended on this hook (like `sails-hook-wish`) have been updated to use native `fetch` instead.