Gathering detailed insights and metrics for vue-jsonp
Gathering detailed insights and metrics for vue-jsonp
npm install vue-jsonp
Typescript
Module System
Node Version
NPM Version
TypeScript (58.36%)
JavaScript (41.64%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
855,314
Last Day
512
Last Week
2,707
Last Month
11,535
Last Year
125,390
MIT License
154 Stars
37 Commits
26 Forks
8 Watchers
17 Branches
3 Contributors
Updated on Feb 09, 2025
Minified
Minified + Gzipped
Latest Version
2.1.0
Package Id
vue-jsonp@2.1.0
Unpacked Size
12.44 kB
Size
4.21 kB
File Count
7
NPM Version
10.2.4
Node Version
22.4.0
Published on
Jan 09, 2025
Cumulative downloads
Total Downloads
Last Day
27.4%
512
Compared to previous day
Last Week
17.2%
2,707
Compared to previous week
Last Month
28%
11,535
Compared to previous month
Last Year
-14%
125,390
Compared to previous year
A tiny library for handling JSONP request.
As Vue plugin:
1import { VueJsonp } from 'vue-jsonp'
2
3// Vue Plugin.
4Vue.use(VueJsonp)
5
6// Now you can use "$jsonp" on Vue components.
7const vm = new Vue()
8const data = await vm.$jsonp('/some-jsonp-url', {
9 myCustomUrlParam: 'veryNice'
10})
Use function directly:
1import { jsonp } from 'vue-jsonp' 2 3// Pass a response type. 4const data = await jsonp<string>('/some-jsonp-url', { 5 myCustomUrlParam: 'veryNice' 6})
1// The request url will be "/some-jsonp-url?type=admin&date=2020&callback=jsonp_{RANDOM_STR}". 2const data = await jsonp('/some-jsonp-url', { 3 type: 'admin', 4 date: 2020 5})
The url uniform is /url?{callbackQuery}={callbackName}&...
and the default is /url?callback=jsonp_{RANDOM_STRING}&...
.
And you can change it like this:
1// The request url will be "/some-jsonp-url?type=admin&date=2020&cb=jsonp_func". 2jsonp('/some-jsonp-url', { 3 callbackQuery: 'cb', 4 callbackName: 'jsonp_func', 5 type: 'admin', 6 date: 2020 7})
VueJsonp: PluginObject<never>
jsonp<T>: (url: string, param?: IJsonpParam, timeout?: number) => Promise<T>
IJsonpParam is the type of param for jsonp function.
1/** 2 * JSONP parameter declaration. 3 */ 4interface IJsonpParam { 5 /** 6 * Callback query name. 7 * This param is used to define the query name of the callback function. 8 * 9 * @example 10 * // The request url will be "/some-url?myCallback=jsonp_func&myCustomUrlParam=veryNice" 11 * const result = await jsonp('/some-url', { 12 * callbackQuery: 'myCallback', 13 * callbackName: 'jsonp_func', 14 * myCustomUrlParam: 'veryNice' 15 * }) 16 * 17 * @default callback 18 */ 19 callbackQuery?: string 20 21 /** 22 * Callback function name. 23 * This param is used to define the jsonp function name. 24 * 25 * @example 26 * // The request url will be "/some-url?myCallback=jsonp_func&myCustomUrlParam=veryNice" 27 * const result = await jsonp('/some-url', { 28 * callbackQuery: 'myCallback', 29 * callbackName: 'jsonp_func', 30 * myCustomUrlParam: 'veryNice' 31 * }) 32 * 33 * @default jsonp_ + randomStr() 34 */ 35 callbackName?: string 36 37 /** 38 * Custom data. 39 */ 40 [key: string]: any 41}
1import Vue from 'vue' 2import { VueJsonp } from 'vue-jsonp' 3 4Vue.use(VueJsonp) 5 6const vm = new Vue() 7const { code, data, message } = await vm.$jsonp<{ 8 code: number, 9 message: string, 10 data: { 11 id: number, 12 nickname: string 13 } 14}>('/my-awesome-url', { 15 name: 'MyName', age: 20 16}) 17 18assert(code === 0) 19assert(message === 'ok') 20assert(data.id === 1) 21assert(data.nickname === 'John Smith')
1import { jsonp } from 'vue-jsonp' 2 3const result = await jsonp<string>('/my-awesome-url') 4assert(result === 'such a jsonp')
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1
Reason
Found 2/25 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
13 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-03-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More