locationify

1.0.1 • Public • Published

Locationify

Substitute window.location properties with values you provide via a url.

Installation

$ npm install locationify --save

Example

source:

var url = window.location.origin + '/post';

bundle:

var url = "http://foo.com" + '/post';

Motivation

Have scripts running off the filesystem return window.location values as though they were hosted. eg. Compiling an application returned by a webserver into a phonegap app.

Usage

var browserify = require('browserify');
var locationify = require('locatonify');

var b = browserify();
b.add('./browser/main.js');
b.transform(locationify('http://foo.com/'));
b.bundle().pipe(process.stdout);

/locationify/

    Package Sidebar

    Install

    npm i locationify

    Weekly Downloads

    1

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • psirenny