New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

phonegap-soundwave

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

phonegap-soundwave - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

lib/create.js

8

lib/index.js

@@ -30,2 +30,10 @@ /*!

/**
* Create a project.
*
* See module for documentation.
*/
module.exports.create = require('./create');
/**
* Listen for connections.

@@ -32,0 +40,0 @@ *

20

lib/middleware.js

@@ -6,4 +6,10 @@ /*!

var connect = require('connect'),
path = require('path'),
fs = require('fs'),
cordova = require('./middleware/cordova'),
mstatic = require('./middleware/static');
cordova_plugins = require('./middleware/cordova_plugins'),
inject = require('./middleware/inject'),
mstatic = require('./middleware/static'),
nocache = require('./middleware/nocache'),
plugins = require('./middleware/plugins');

@@ -20,2 +26,8 @@ /**

// no-cache header
app.use(nocache());
// inject JavaScript to refresh app or navigate home
app.use(inject());
// serve static assets

@@ -27,2 +39,8 @@ app.use(mstatic());

// serve cordova_plugin js if 404'd out from previous static server
app.use(cordova_plugins());
// serve plugins if 404'd out from previous static server
app.use(plugins());
// return the request listener

@@ -29,0 +47,0 @@ return function(req, res, next) {

5

lib/middleware/cordova.js

@@ -17,7 +17,8 @@ /*!

return function(req, res, next) {
if (req.url.indexOf('cordova.js') > 0) {
if (req.url.indexOf('cordova.js') >= 0) {
// assume ios only for now
var cordovajs = fs.readFileSync(
path.join(__dirname, '../../res/middleware/cordova/cordova.ios.js')
path.join(__dirname, '../../res/middleware/cordova/ios/cordova.js')
);
res.writeHead(200, {'Content-Type': 'text/javascript'});

@@ -24,0 +25,0 @@ res.end(cordovajs);

{
"name": "phonegap-soundwave",
"description": "Connect middleware to stream a PhoneGap app.",
"version": "0.3.0",
"version": "0.4.0",
"homepage": "https://github.com/phonegap/node-phonegap-soundwave",

@@ -23,3 +23,9 @@ "repository": {

"connect": "2.12.0",
"node-static": "0.7.0"
"connect-inject": "0.3.2",
"home-dir": "0.1.2",
"node-static": "0.7.0",
"request": "2.33.0",
"request-progress": "0.3.1",
"shelljs": "0.2.6",
"tar": "0.1.19"
},

@@ -26,0 +32,0 @@ "devDependencies": {

@@ -83,4 +83,49 @@ # phonegap-soundwave [![Build Status][travis-ci-img]][travis-ci-url]

### soundwave.create(options)
The project is created from the same app template used by the PhoneGap CLI
and Cordova CLI. When a template does not exist, it is fetched and saved
in the common directory:
~/.cordova/lib/www/phonegap/VERSION/
Options:
- `options` {Object}
- `path` {String} is the path to create the project.
- `version` {String} defines the PhoneGap app version.
Events:
- `progress` emits state while downloading the app template.
- `state` {Object} with `received`, `total`, and `percentage`.
- `error` emitted when an error occurs.
- `e` {Error}
- `complete` emits when the project has been created.
- `data` {Object} is indentical to the input `options`.
Example:
soundwave.create({
path: 'path/to/app',
version: '3.3.0'
})
.on('progress', function(state) {
// only emitted when downloading a template.
// state values are only defined when response supports
// content-length header.
if (state.percentage) {
console.log('downloaded: ' + state.percentage + '%');
}
}
.on('error', function(e) {
// handle error
})
.on('complete', function(data) {
// data.path is the app path
console.log('created project at: ' + data.path);
});
[travis-ci-img]: https://travis-ci.org/phonegap/node-phonegap-soundwave.png?branch=master
[travis-ci-url]: http://travis-ci.org/phonegap/node-phonegap-soundwave
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