New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@deepjs/jsonp

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deepjs/jsonp

jsonp for web

latest
npmnpm
Version
0.2.9
Version published
Maintainers
1
Created
Source

JSONP

独立包,功能强大,使用简单

使用

// app.js 引入
import jsonp from '@deepjs/jsonp'
import axios from 'axios'

// axios.jsonp = jsonp;

const params = {
  ak: 'BAIDU_MAP_AK',
  location: `${lat},${lng}`,
  coord_type: 'gcj02',
  output: 'json',
  s: 1,
}
const url = `https://api.map.baidu.com/geocoder/v2/?${qs.stringify(params)}`
jsonp(url).then(res => {
  const { result } = res
  const {
    cityCode = '', // 城市code
    province = '', // 省
    city = '',     // 市
    district = '', // 区
    street = '',   // 路
    street_number = '', // 号
  } = result.addressComponent

  // ...
})

Keywords

jsonp

FAQs

Package last updated on 17 Sep 2020

Did you know?

Socket

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.

Install

Related posts