### Install Dependencies and Clone Repositories
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/lodash/release.md
Installs npm dependencies, clones the lodash and lodash-cli repositories, and sets up the lodash-cli within the project's node_modules. This prepares the environment for building lodash.
```sh
npm run build
npm run doc
npm i
git clone --depth=10 --branch=master git@github.com:lodash-archive/lodash-cli.git ./node_modules/lodash-cli
mkdir -p ./node_modules/lodash-cli/node_modules/lodash; cd $_; cp ../../../../lodash.js ./lodash.js; cp ../../../../package.json ./package.json
cd ../../; npm i --production; cd ../..
cp lodash.js npm-package/lodash.js
cp dist/lodash.min.js npm-package/lodash.min.js
cp LICENSE npm-package/LICENSE
```
```sh
git clone https://github.com/lodash/lodash.git
git clone https://github.com/bnjmnt4n/lodash-cli.git
```
--------------------------------
### Install p-try using npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/p-try/readme.md
This snippet shows the command to install the p-try package using npm, the Node Package Manager. This is a prerequisite for using the p-try module in your project.
```bash
npm install p-try
```
--------------------------------
### Node.js Installation and Usage of BigInteger.js
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/big-integer/README.md
This example demonstrates how to install and require the BigInteger.js library in a Node.js environment. It uses npm for installation and the require function to import the library.
```bash
npm install big-integer
```
```javascript
var bigInt = require("big-integer");
```
--------------------------------
### Install Cordova Camera Plugin
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/plugins/cordova-plugin-camera/README.md
Provides commands for installing the cordova-plugin-camera. It includes instructions for modern Cordova versions (5.0+), deprecated IDs for older versions, and direct installation from a Git repository URL for unstable builds. These commands are executed in a command-line interface.
```bash
cordova plugin add cordova-plugin-camera
```
```bash
cordova plugin add org.apache.cordova.camera
```
```bash
cordova plugin add https://github.com/apache/cordova-plugin-camera.git
```
--------------------------------
### Install openid-client using npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/openid-client/README.md
Installs the openid-client library using npm. This command is for Node.js environments and requires npm to be installed.
```console
npm install openid-client
```
--------------------------------
### Install Picomatch with npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/picomatch/README.md
This snippet shows how to install the picomatch library using npm. It is a standard command-line instruction for package installation.
```sh
npm install --save picomatch
```
--------------------------------
### Install simple-concat using npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/simple-concat/README.md
This command installs the simple-concat package from npm. Ensure you have Node.js and npm installed on your system.
```bash
npm install simple-concat
```
--------------------------------
### Install verb and generator for building docs
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/is-extglob/README.md
This command installs 'verb' and 'verb-generate-readme' globally, which are tools used to build the project's documentation. After installation, 'verb' can be run to generate the README file.
```sh
npm install -g verb verb-generate-readme && verb
```
--------------------------------
### Install Node.js Glob
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/glob/README.md
Install the glob library using npm. This is the first step before using glob in your Node.js project.
```bash
npm i glob
```
--------------------------------
### Install @nodelib/fs.scandir using npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/@nodelib/fs.scandir/README.md
This command installs the @nodelib/fs.scandir package using npm. Ensure you have Node.js and npm installed on your system.
```console
npm install @nodelib/fs.scandir
```
--------------------------------
### Install dash-ast via npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/dash-ast/README.md
This command installs the dash-ast package and its dependencies using npm. Ensure you have Node.js and npm installed on your system.
```bash
npm install dash-ast
```
--------------------------------
### Install Whitelist Plugin (Bash)
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/cordova-plugin-whitelist/README.md
Commands to install the cordova-plugin-whitelist using the Cordova CLI and npm. This includes adding the plugin and preparing the project for the changes.
```bash
$cordova plugin add cordova-plugin-whitelist
$cordova prepare
```
--------------------------------
### Camera API Examples
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/plugins/cordova-plugin-camera/doc/fr/index.md
Examples demonstrating how to take a photo and retrieve it as a base64-encoded string or a file URI.
```APIDOC
## Taking a Photo and Retrieving as Base64
### Description
Takes a photo using the device's camera and returns the image data as a base64-encoded string.
### Method
`navigator.camera.getPicture`
### Parameters
- **onSuccess** (function) - Callback function that receives the base64 image data.
- **onFail** (function) - Callback function that is called if the operation fails, receiving an error message.
- **options** (object) - Optional configuration object.
- **quality** (number) - Quality of the saved image (0-100). Default is 50.
- **destinationType** (number) - Desired format of the return value. `Camera.DestinationType.DATA_URL` (0) for base64.
### Request Example
```javascript
navigator.camera.getPicture(onSuccess, onFail, {
quality: 50,
destinationType: Camera.DestinationType.DATA_URL
});
function onSuccess(imageData) {
var image = document.getElementById('myImage');
image.src = "data:image/jpeg;base64," + imageData;
}
function onFail(message) {
alert('Failed because: ' + message);
}
```
## Taking a Photo and Retrieving File URI
### Description
Takes a photo using the device's camera and returns the file URI of the saved image.
### Method
`navigator.camera.getPicture`
### Parameters
- **onSuccess** (function) - Callback function that receives the image file URI.
- **onFail** (function) - Callback function that is called if the operation fails, receiving an error message.
- **options** (object) - Optional configuration object.
- **quality** (number) - Quality of the saved image (0-100). Default is 50.
- **destinationType** (number) - Desired format of the return value. `Camera.DestinationType.FILE_URI` (1) for file URI.
### Request Example
```javascript
navigator.camera.getPicture(onSuccess, onFail, {
quality: 50,
destinationType: Camera.DestinationType.FILE_URI
});
function onSuccess(imageURI) {
var image = document.getElementById('myImage');
image.src = imageURI;
}
function onFail(message) {
alert('Failed because: ' + message);
}
```
```
--------------------------------
### Install acorn-node Package
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/acorn-node/README.md
Installs the acorn-node package using npm. This is the first step to integrate acorn-node into your project.
```bash
npm install acorn-node
```
--------------------------------
### Install Camera Plugin
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/plugins/cordova-plugin-camera/doc/ja/README.md
This command installs the cordova-plugin-camera using the Cordova CLI. It adds the necessary native and JavaScript files to the project.
```bash
cordova plugin add cordova-plugin-camera
```
--------------------------------
### Cordova Installation Command Line
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/readme.md
Installs the Cordova command-line interface globally using npm. This command ensures that the `cordova` command is available system-wide for managing Cordova projects.
```bash
npm install -g cordova
```
--------------------------------
### Browser HTTP GET Request Example
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/stream-http/README.md
Demonstrates how to perform an HTTP GET request in a browser environment using a JavaScript library, handling response data and end events. This snippet is specific to browser JavaScript execution.
```javascript
http.get('/bundle.js', function (res) {
var div = document.getElementById('result');
div.innerHTML += 'GET /beep
';
res.on('data', function (buf) {
div.innerHTML += buf;
});
res.on('end', function () {
div.innerHTML += '
__END__';
});
})
```
--------------------------------
### Install bplist-parser via npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/bplist-parser/README.md
This command installs the bplist-parser package from the npm registry. It is a prerequisite for using the library in your Node.js project.
```bash
$ npm install bplist-parser
```
--------------------------------
### Install Node.js Dependencies for Cordova.js
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/cordova-js/README.md
Installs all necessary Node.js dependencies for building Cordova.js. Requires Node.js and npm to be installed.
```bash
npm install
```
--------------------------------
### Install safe-buffer Package
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/safe-buffer/README.md
This snippet shows how to install the 'safe-buffer' package using npm. It is a prerequisite for using the package's functionalities.
```bash
npm install safe-buffer
```
--------------------------------
### iOS Camera Plugin Installation
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/plugins/cordova-plugin-camera/README.md
Instructions for installing the camera plugin on iOS, including required usage descriptions.
```APIDOC
## iOS Camera Plugin Installation
Since iOS 10, it's mandatory to add `NSCameraUsageDescription` and `NSPhotoLibraryUsageDescription` to your app's `info.plist` file.
- `NSCameraUsageDescription`: Describes the reason the app accesses the user’s camera.
- `NSPhotoLibraryUsageDescription`: Describes the reason the app accesses the user's photo library.
These strings are displayed to the user when the system prompts for permission.
**Installation Example with Usage Descriptions:**
```bash
cordova plugin add cordova-plugin-camera --variable CAMERA_USAGE_DESCRIPTION="your usage message" --variable PHOTOLIBRARY_USAGE_DESCRIPTION="your usage message"
```
If these variables are not provided during installation, the plugin will add an empty string as the value for these keys.
```
--------------------------------
### Installation with npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/constants-browserify/README.md
Provides the command to install the constants-browserify package using npm, the Node Package Manager. This is a prerequisite for using the module in your project.
```bash
npm install constants-browserify
```
--------------------------------
### Browser Installation and Usage of object-hash (JavaScript)
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/object-hash/readme.markdown
Provides instructions and a code example for using the object-hash library in a browser environment. It involves including the library via a script tag and then utilizing its functions, such as `objectHash.sha1`.
```html
```
--------------------------------
### Install buffer-from using npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/buffer-from/readme.md
This command installs the 'buffer-from' package as a dependency for your project.
```sh
npm install --save buffer-from
```
--------------------------------
### Install Whitelist Plugin (Bash)
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/plugins/cordova-plugin-whitelist/README.md
Commands to install the cordova-plugin-whitelist using the Cordova CLI and npm. After installation, `cordova prepare` is used to apply the changes to the project.
```bash
$ cordova plugin add cordova-plugin-whitelist
$cordova prepare
```
--------------------------------
### Install pify
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/pify/readme.md
Install the pify package using npm. This is the first step to using pify in your Node.js project.
```bash
npm install pify
```
--------------------------------
### Install fast-json-parse
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/fast-json-parse/README.md
Installs the fast-json-parse module using npm. This command adds the package as a dependency to your project.
```bash
npm i fast-json-parse --save
```
--------------------------------
### Install @nodelib/fs.walk
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/@nodelib/fs.walk/README.md
Installs the @nodelib/fs.walk package using npm. This is the initial step to integrate the directory traversal functionality into your Node.js project.
```console
npm install @nodelib/fs.walk
```
--------------------------------
### Install Punycode.js via Bower
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/url/node_modules/punycode/README.md
This command installs the Punycode.js library using Bower, a front-end package manager. It's suitable for browser-based projects.
```bash
bower install punycode
```
--------------------------------
### module-deps npm Installation
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/module-deps/readme.markdown
Provides npm commands for installing the module-deps package locally for project use and globally for command-line access.
```bash
npm install module-deps
npm install -g module-deps
```
--------------------------------
### Install Universalify with npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/universalify/README.md
This command installs the universalify package using npm. It's a prerequisite for using the library in your Node.js project.
```bash
npm install universalify
```
--------------------------------
### Install lodash.memoize using npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/lodash.memoize/README.md
These commands demonstrate how to install the lodash.memoize package globally and as a dependency for a project using npm.
```bash
npm i -g npm
npm i --save lodash.memoize
```
--------------------------------
### Cordova Plugin Installation Command (Shell)
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/plugins/cordova-plugin-ble-peripheral/README.md
This command installs the BLE Peripheral plugin directly from its GitHub repository using the Cordova CLI. This is a standard method for adding plugins that are not yet published to npm. Ensure you have Cordova installed and configured.
```shell
$cordova plugin add https://github.com/simplifier-ag/cordova-plugin-ble-peripheral.git
```
--------------------------------
### Install @nodelib/fs.stat using npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/@nodelib/fs.stat/README.md
Installs the @nodelib/fs.stat package, a utility for getting file status, using the npm package manager. This is a prerequisite for using the package in your Node.js project.
```console
npm install @nodelib/fs.stat
```
--------------------------------
### Install p-finally
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/p-finally/readme.md
Install the p-finally package using npm. This command downloads and adds the package to your project's dependencies.
```shell
npm install --save p-finally
```
--------------------------------
### Install dependencies and run tests
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/is-extglob/README.md
This command installs the development dependencies for the project and then runs the test suite. It's typically used by developers to ensure the code is functioning correctly.
```sh
npm install -d && npm test
```
--------------------------------
### Browserify Command Line Bundling
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/browserify/readme.markdown
This snippet shows the basic command-line usage of Browserify to create a bundle. It takes an entry point file (`main.js`) and outputs the bundled JavaScript to another file (`bundle.js`). This is the core command for generating a Browserify-compatible script.
```bash
browserify main.js > bundle.js
```
--------------------------------
### Install Punycode.js via Component
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/url/node_modules/punycode/README.md
This command installs the Punycode.js library using Component, a front-end package manager. It's an alternative for managing front-end dependencies.
```bash
component install bestiejs/punycode.js
```
--------------------------------
### Initialize Browserify Instance
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/browserify/readme.markdown
Creates a new Browserify instance with optional entry files and configuration options. Supports various input types for files and a comprehensive options object for customization.
```javascript
const browserify = require('browserify');
// With entry files
const b = browserify(['./src/main.js', './lib/util.js'], {
basedir: './src'
});
// With options only
const b2 = browserify({
entries: ['./src/main.js'],
transform: ['babelify'],
debug: true
});
// No arguments
const b3 = browserify();
```
--------------------------------
### Install is-buffer using npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/is-buffer/README.md
This command installs the 'is-buffer' package, which is a dependency for the usage examples. It is typically run in a terminal or command prompt.
```bash
npm install is-buffer
```
--------------------------------
### Browserify Installation via npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/browserify/readme.markdown
This code snippet illustrates how to install the Browserify command-line tool globally using npm. This allows you to use the `browserify` command in your terminal to bundle your JavaScript modules.
```bash
npm install -g browserify
```
--------------------------------
### Get Main Application Installation ID
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/readme.md
Fetches the unique installation ID of the main application. This ID can be used for various tracking or identification purposes within the application ecosystem.
```javascript
console.log(cordova.plugins.condo.hostApplication.installationID());
```
--------------------------------
### Install queue-microtask via npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/queue-microtask/README.md
This command installs the `queue-microtask` package using npm. It's a prerequisite for using the library in your Node.js or browser project.
```bash
npm install queue-microtask
```
--------------------------------
### Install JSONStream via npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/JSONStream/readme.markdown
Installs the JSONStream module using npm. This is the first step to using the library in your Node.js project.
```bash
npm install JSONStream
```
--------------------------------
### Build and Package Lodash
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/lodash/release.md
Builds the lodash library, generates documentation, and prepares distribution files including core, minified, and modularized versions. It also copies necessary files for packaging.
```sh
npm run build
npm run doc
mkdir ../lodash-temp
cp lodash.js dist/lodash.min.js dist/lodash.core.js dist/lodash.core.min.js ../lodash-temp/
cp ../lodash-temp/lodash.core.js core.js
cp ../lodash-temp/lodash.core.min.js core.min.js
cp ../lodash-temp/lodash.js lodash.js
cp ../lodash-temp/lodash.min.js lodash.min.js
```
--------------------------------
### Install shasum-object using npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/shasum-object/README.md
This snippet shows the command to install the shasum-object package using npm. This is a prerequisite for using the package in a Node.js project.
```bash
npm install shasum-object
```
--------------------------------
### Browserify API: Basic Bundling
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/browserify/readme.markdown
Shows how to use the Browserify API programmatically in Node.js. It initializes a Browserify instance, adds an entry point file ('./browser/main.js'), and pipes the bundled output to standard output. This approach allows for dynamic configuration and integration within larger build processes.
```javascript
var browserify = require('browserify');
var b = browserify();
b.add('./browser/main.js');
b.bundle().pipe(process.stdout);
```
--------------------------------
### Install Cordova Camera Plugin (Shell)
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/plugins/cordova-plugin-camera/doc/fr/index.md
This command installs the cordova-plugin-camera using the Cordova CLI. It's a prerequisite for using any of the plugin's functionalities.
```shell
Cordova plugin add cordova-plugin-camera
```
--------------------------------
### Windows Cordova Build Scripts Command Line
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/readme.md
A sequence of commands for Windows users to prepare and package the Cordova project for Android. It involves navigating to the Cordova application directory, preparing the iOS platform (which is used to build the `www.zip`), creating the `www.zip` archive, and copying it to the Android project's raw resources directory.
```bash
cd MainCordovaApplication
cordova prepare ios
tar -a -c -f www.zip www
copy /y www.zip ..\app\src\main\res\raw\www.zip
```
--------------------------------
### Install console-browserify with npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/console-browserify/README.md
This command installs the console-browserify package using npm. It's the standard way to add the package as a dependency to your project if you're not using a bundler that includes it automatically.
```bash
npm install console-browserify
```
--------------------------------
### Install path-key using npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/path-key/readme.md
This snippet shows how to install the path-key package using npm, a common package manager for Node.js projects. This is a prerequisite for using the package in your application.
```bash
npm install path-key
```
--------------------------------
### Install Buffer Module with npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/buffer/README.md
Installs the 'buffer' module using npm. This is the standard method for adding the module to your project when not using a bundler directly.
```bash
npm install buffer
```
--------------------------------
### Example: SourceWrapper Implementation
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/concat-stream/node_modules/readable-stream/doc/stream.markdown
An example demonstrating how to wrap a low-level source object with a pause/resume mechanism into a `Readable` stream.
```APIDOC
### Example: Wrapping a Low-Level Source
```javascript
// Assuming 'util' is required and 'Readable' is accessible
const util = require('util');
const { Readable } = require('stream');
function SourceWrapper(options) {
Readable.call(this, options);
this._source = getLowlevelSourceObject(); // Replace with actual source retrieval
this._source.ondata = (chunk) => {
// If push() returns false, stop reading from source
if (!this.push(chunk))
this._source.readStop();
};
this._source.onend = () => {
// Signal end of stream
this.push(null);
};
}
util.inherits(SourceWrapper, Readable);
// _read will be called when the stream wants to pull more data
SourceWrapper.prototype._read = function(size) {
this._source.readStart();
};
// Usage:
// const wrapper = new SourceWrapper();
// wrapper.pipe(process.stdout);
```
```
--------------------------------
### Install fast-glob using npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/fast-glob/README.md
This command installs the fast-glob package, which is a Node.js module that provides fast and efficient file searching using glob patterns.
```console
npm install fast-glob
```
--------------------------------
### Browserify Module Initialization
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/browserify/readme.markdown
Illustrates the basic setup for using the Browserify module in a Node.js environment. It shows how to require the browserify package, which is the entry point for programmatic use of the bundler.
```javascript
var browserify = require('browserify')
```
--------------------------------
### Get Parent Directories in Node.js (dirname)
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/parents/readme.markdown
Demonstrates how to use the 'parents' module to get all parent directories of the current directory (__dirname). This is useful for understanding directory structures in Unix-like environments. It requires the 'parents' module to be installed.
```javascript
var parents = require('parents');
var dirs = parents(__dirname);
console.dir(dirs);
```
--------------------------------
### Get Parent Directories in Node.js (win32)
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/parents/readme.markdown
Shows how to use the 'parents' module to get parent directories for a specified Windows path. This example explicitly sets the platform to 'win32' to handle Windows-specific path conventions. Requires the 'parents' module.
```javascript
var parents = require('parents');
var dir = 'C:\\Program Files\\Maxis\\Sim City 2000\\cities';
var dirs = parents(dir, { platform : 'win32' });
console.dir(dirs);
```
--------------------------------
### Install hash.js using npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/hash.js/README.md
This snippet shows how to install the hash.js library using npm, the Node Package Manager. It is a prerequisite for using the library in Node.js projects.
```sh
npm install hash.js
```
--------------------------------
### Install and Setup Cordova Import NPM
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/cordova-import-npm/README.md
This snippet shows the commands to install the cordova-import-npm package and set up the necessary hooks and configuration file in a Cordova project. It adds a 'before_prepare' hook to config.xml and creates an empty npmFilesToImport.json.
```bash
npm install cordova-import-npm
npx setup-cordova-import-npm
```
--------------------------------
### Install parents Module via npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/parents/readme.markdown
Provides the command to install the 'parents' Node.js module using npm. This is a prerequisite for using the module in your projects.
```bash
npm install parents
```
--------------------------------
### Get Source Map Module Reference
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/source-map/README.md
Provides examples for obtaining a reference to the 'source-map' module in different JavaScript environments, including Node.js and browser builds.
```javascript
// Node.js
var sourceMap = require('source-map');
// Browser builds
var sourceMap = window.sourceMap;
// Inside Firefox
const sourceMap = require("devtools/toolkit/sourcemap/source-map.js");
```
--------------------------------
### Get Host Application Environment Info (JavaScript)
Source: https://context7.com/open-condo-software/mobile_cordova_android_demoapplication/llms.txt
Synchronously retrieves information about the host application environment using Cordova plugins. It checks for demo environment status, gets the server base URL, installation ID, device ID, and application locale. This information is crucial for configuring API clients, analytics, and internationalization.
```javascript
document.addEventListener('deviceready', function() {
// Check if running in demo environment
const isDemoEnv = cordova.plugins.condo.hostApplication.isDemoEnvironment();
console.log("Is Demo Environment:", isDemoEnv);
if (isDemoEnv) {
document.body.classList.add('demo-mode');
enableDebugTools();
}
// Get base server URL
const baseURL = cordova.plugins.condo.hostApplication.baseURL();
console.log("Server Base URL:", baseURL);
// Configure API client
const apiClient = new ApiClient({
baseURL: baseURL,
headers: {'X-App-Type': 'miniapp'}
});
// Get installation ID for analytics
const installationID = cordova.plugins.condo.hostApplication.installationID();
console.log("Installation ID:", installationID);
analytics.setUserId(installationID);
// Get device ID for device-specific operations
const deviceID = cordova.plugins.condo.hostApplication.deviceID();
console.log("Device ID:", deviceID);
localStorage.setItem('deviceId', deviceID);
// Get application locale for i18n
const locale = cordova.plugins.condo.hostApplication.locale();
console.log("App Locale:", locale);
// Set up internationalization
i18n.changeLanguage(locale);
document.documentElement.lang = locale;
}, false);
```
--------------------------------
### Install Benchmark Dependencies - Shell
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/micromatch/README.md
Installs the necessary dependencies to run performance benchmarks for the glob pattern libraries. This command should be executed within the 'bench' directory.
```shell
cd bench && npm install
```
--------------------------------
### JavaScript: Take Photo and Get File URI
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/plugins/cordova-plugin-camera/doc/fr/index.md
Example of taking a photo using the Cordova camera plugin and retrieving the image's file URI. The `destinationType` is set to `Camera.DestinationType.FILE_URI`.
```javascript
navigator.camera.getPicture (onSuccess, onFail, {
quality: 50,
destinationType: Camera.DestinationType.FILE_URI
}) ;
function onSuccess(imageURI) {
var image = document.getElementById('myImage') ;
image.SRC = imageURI ;
}
function onFail(message) {
alert (' a échoué car: "+ message);
}
```
--------------------------------
### Install balanced-match using npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/balanced-match/README.md
Provides the command to install the balanced-match package using npm, the Node Package Manager. This is the standard method for adding the library as a dependency to a Node.js project.
```bash
npm install balanced-match
```
--------------------------------
### Install Punycode.js via npm
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/url/node_modules/punycode/README.md
This command installs the Punycode.js library using npm, a package manager for Node.js. It's primarily for older Node.js versions prior to v0.6.2.
```bash
npm install punycode
```
--------------------------------
### HTML Structure for vm-browserify Example (HTML)
Source: https://github.com/open-condo-software/mobile_cordova_android_demoapplication/blob/master/MainCordovaApplication/node_modules/vm-browserify/readme.markdown
This HTML snippet sets up the basic structure for the vm-browserify example. It includes necessary scripts for jQuery and the bundled JavaScript file (bundle.js), and a span element to display the result of the executed code.
```html