Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cordova-plugin-wifi-manager

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-wifi-manager - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

.eslintrc.js

6

CHANGELOG.md
# Change Log
## [0.2.0](https://github.com/sushichop/cordova-plugin-wifi-manager/tree/0.2.0) (2019-02-10)
**Implemented enhancements:**
- Add type definition
## [0.1.0](https://github.com/sushichop/cordova-plugin-wifi-manager/tree/0.1.0) (2018-05-04)

@@ -4,0 +10,0 @@

24

package.json
{
"name": "cordova-plugin-wifi-manager",
"version": "0.1.0",
"version": "0.2.0",
"description": "Wi-Fi Manager Plugin for Apache Cordova",
"engines": {
"node": ">= 8"
},
"types": "./types/index.d.ts",
"cordova": {

@@ -23,4 +27,18 @@ "id": "cordova-plugin-wifi-manager",

],
"author": "sushichop.net",
"license": "MIT"
"scripts": {
"lint": "eslint 'www/**/*.js'",
"test": "npm run lint"
},
"author": "Koichi Yokota",
"license": "MIT",
"devDependencies": {
"eslint": "^5.13.0",
"eslint-cli": "^1.1.1",
"eslint-config-semistandard": "^13.0.0",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-node": "^8.0.1",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0"
}
}

33

README.md
# cordova-plugin-wifi-manager
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/sushichop/cordova-plugin-wifi-manager/blob/master/LICENSE)
[![npm version](https://img.shields.io/npm/v/cordova-plugin-wifi-manager.svg?colorB=blue)](https://www.npmjs.com/package/cordova-plugin-wifi-manager)
[![Build Status](https://img.shields.io/travis/sushichop/cordova-plugin-wifi-manager/master.svg)](https://travis-ci.org/sushichop/cordova-plugin-wifi-manager)
[![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/Flet/semistandard)
Wi-Fi Manager Plugin for Apache Cordova

@@ -7,3 +12,3 @@

- Android: 4.4 or later
- Android: 5.0 or later
- iOS: 10.0 or later

@@ -22,10 +27,14 @@

```javascript
window.document.addEventListener('deviceready', onDeviceReady, false);
document.addEventListener('deviceready', onDeviceReady, false);
function onDeviceReady () {
window.wifiManager.connect(
wifimanager.connect(
'TARGET_SSID',
'TARGET_PASSPHRASE',
function (success) { console.log(success); },
function (failure) { console.log(failure); }
function (ssid, passphrase) {
console.log('Successful. ssid: ' + ssid + ', passphrase: ' + passphrase);
},
function (code, message) {
console.log('Failed. code: ' + code + ', message: ' + message);
}
);

@@ -38,9 +47,13 @@ }

```javascript
window.document.addEventListener('deviceready', onDeviceReady, false);
document.addEventListener('deviceready', onDeviceReady, false);
function onDeviceReady () {
window.wifiManager.disconnect(
function onDeviceReady () {
wifimanager.disconnect(
'TARGET_SSID',
function (success) { console.log(success); },
function (failure) { console.log(failure); }
function (ssid) {
console.log('Successful. ssid: ' + ssid);
},
function (code, message) {
console.log('Failed. code: ' + code + ', message: ' + message);
}
);

@@ -47,0 +60,0 @@ }

@@ -1,18 +0,29 @@

"use strict";
'use strict';
var PLUGIN_NAME = 'WiFiManager';
var argscheck = require('cordova/argscheck');
var exec = cordova.require('cordova/exec');
var exec = require('cordova/exec');
/**
* Connects to Wi-Fi access point.
*
* @param ssid {String} SSID of Wi-Fi access point
* @param passphrase {String} passphrase of Wi-Fi access point
* @param successCb {Function} success callback
* @param failureCb {Function} failure callback
* @param onSuccess {Function} success callback
* @param onFailure {Function} failure callback
*
* @example
* wifimanager.connect(
* 'TARGET_SSID',
* 'TARGET_PASSPHRASE',
* function (ssid, passphrase) {
* console.log('Successful. ssid: ' + ssid + ', passphrase: ' + passphrase);
* },
* function (code, message) {
* console.log('Failed. code: ' + code + ', message: ' + message);
* }
* );
*/
function connect(ssid, passphrase, successCb, failureCb) {
function connect (ssid, passphrase, onSuccess, onFailure) {
argscheck.checkArgs('ssFF', PLUGIN_NAME + '.connect', arguments);
exec(successCb, failureCb, PLUGIN_NAME, 'connect', [ssid, passphrase]);
exec(onSuccess, onFailure, PLUGIN_NAME, 'connect', [ssid, passphrase]);
}

@@ -22,10 +33,20 @@

* Disconnects from Wi-Fi access point.
* @param ssid {String} SSID of Wi-Fi access point
* @param onSuccess {Function} success callback
* @param onFailure {Function} failure callback
*
* @param ssid {String} SSID of Wi-Fi access point
* @param successCb {Function} success callback
* @param failureCb {Function} failure callback
* @example
* wifimanager.disconnect(
* 'TARGET_SSID',
* function (ssid) {
* console.log('Successful. ssid: ' + ssid);
* },
* function (code, message) {
* console.log('Failed. code: ' + code + ', message: ' + message);
* }
* );
*/
function disconnect(ssid, successCb, failureCb) {
function disconnect (ssid, onSuccess, onFailure) {
argscheck.checkArgs('sFF', PLUGIN_NAME + '.disconnect', arguments);
exec(successCb, failureCb, PLUGIN_NAME, 'disconnect', [ssid]);
exec(onSuccess, onFailure, PLUGIN_NAME, 'disconnect', [ssid]);
}

@@ -32,0 +53,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc