# n-jsonp **Repository Path**: mirrors_Financial-Times/n-jsonp ## Basic Information - **Project Name**: n-jsonp - **Description**: ❌Deprecated: This package is no longer maintained, consider using fetch() and CORS instead - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-24 - **Last Updated**: 2026-07-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Next JSONP ## Deprecated This package is no longer maintained. JSONP is required only for older browsers that don't support requests from third party domains. For modern browsers you can use fetch() and CORS instead. Contains both a client (bower) and server (npm) module ### Client Emulate [fetch's](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) interface, but use JSONP under the hood #### Install bower install -S n-jsonp #### Usage import jsonpFetch from 'n-jsonp'; const opts = { timeout: 1000 }; jsonpFetch('http://other.domain.com/foo', opts) .then(data => { ... }); Where `opts` can take * `{number} [timeout=2000]` ### Server Express middleware, to work with the client module #### Install npm install -S @financial-times/n-jsonp #### Usage const app = require('express'); const jsonpFetch = require('@financial-times/n-jsonp').default app = express(); app.use(jsonpMiddleware); app.get('/', (req, res) => { res.jsonp('a response'); }); app.get('/error', (req, res) => { res.status(500) .jsonp('uh-oh'); }); ## Development ### Setup Requires $ make install ### Testing Requires Firefox $ make test