{ "_args": [ [ { "raw": "nativescript-imagepicker@4.0.1", "scope": null, "escapedName": "nativescript-imagepicker", "name": "nativescript-imagepicker", "rawSpec": "4.0.1", "spec": "4.0.1", "type": "version" }, "/Users/Tnova/Desktop/SHGR/shagrir bitbucket/shagrir" ] ], "_from": "nativescript-imagepicker@4.0.1", "_id": "nativescript-imagepicker@4.0.1", "_inCache": true, "_location": "/nativescript-imagepicker", "_nodeVersion": "6.10.1", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/nativescript-imagepicker-4.0.1.tgz_1508939406686_0.6399101184215397" }, "_npmUser": { "name": "veselina.radeva", "email": "veselina.radeva@progress.com" }, "_npmVersion": "3.10.10", "_phantomChildren": {}, "_requested": { "raw": "nativescript-imagepicker@4.0.1", "scope": null, "escapedName": "nativescript-imagepicker", "name": "nativescript-imagepicker", "rawSpec": "4.0.1", "spec": "4.0.1", "type": "version" }, "_requiredBy": [ "#USER", "/" ], "_resolved": "https://registry.npmjs.org/nativescript-imagepicker/-/nativescript-imagepicker-4.0.1.tgz", "_shasum": "61fe83d8cbe271199e7d546b7a55c7649d864883", "_shrinkwrap": null, "_spec": "nativescript-imagepicker@4.0.1", "_where": "/Users/Tnova/Desktop/SHGR/shagrir bitbucket/shagrir", "author": { "name": "NativeScript Team" }, "bootstrapper": "nativescript-plugin-seed", "bugs": { "url": "https://github.com/NativeScript/nativescript-imagepicker/issues" }, "dependencies": { "nativescript-permissions": "~1.2.3", "nativescript-pro-ui": "^3.1.2" }, "description": "A plugin for the NativeScript framework implementing multiple image picker", "devDependencies": { "tns-core-modules": "^3.1.0", "tns-platform-declarations": "^3.0.0", "tslint": "~5.4.3", "typescript": "~2.3.0" }, "directories": {}, "dist": { "shasum": "61fe83d8cbe271199e7d546b7a55c7649d864883", "tarball": "https://registry.npmjs.org/nativescript-imagepicker/-/nativescript-imagepicker-4.0.1.tgz" }, "homepage": "https://github.com/NativeScript/nativescript-imagepicker", "keywords": [ "NativeScript", "JavaScript", "Android", "iOS" ], "license": "Apache-2.0", "main": "imagepicker", "maintainers": [ { "name": "panayot.cankov", "email": "panayot.cankov@telerik.com" }, { "name": "tns-bot", "email": "nativescript@telerik.com" } ], "name": "nativescript-imagepicker", "nativescript": { "platforms": { "android": "3.0.0", "ios": "3.0.0" } }, "optionalDependencies": {}, "readme": "# NativeScript Image Picker ![apple](https://cdn3.iconfinder.com/data/icons/picons-social/57/16-apple-32.png) ![android](https://cdn4.iconfinder.com/data/icons/logos-3/228/android-32.png) \n\n\n[![npm](https://img.shields.io/npm/v/nativescript-imagepicker.svg)](https://www.npmjs.com/package/nativescript-imagepicker)\n[![npm](https://img.shields.io/npm/dm/nativescript-imagepicker.svg)](https://www.npmjs.com/package/nativescript-imagepicker)\n[![Build Status](https://travis-ci.org/NativeScript/nativescript-imagepicker.svg?branch=master)](https://travis-ci.org/NativeScript/nativescript-imagepicker)\n\nImagepicker plugin supporting both single and multiple selection.\n
Plugin supports **iOS8+** and uses [Photos Framework](https://developer.apple.com/library/prerelease/ios//documentation/Photos/Reference/Photos_Framework/index.html).\n
For **Android** it uses Intents to open the stock images or file pickers. For Android 6 (API 23) and above the permissions to read file storage should be explicitly required. See demo for implementation details.\n\n## Installation\n\nIn Command prompt / Terminal navigate to your application root folder and run:\n\n```\ntns plugin add nativescript-imagepicker\n```\n\n## Usage \n\nThe best way to explore the usage of the plugin is to inspect both demo apps in the plugin repository. \nIn `demo` folder you can find the usage of the plugin for TypeScript non-Angular application. Refer to `demo/app/main-page.ts`.\nIn `demo-angular` is the usage in an Angular app. Refer to `demo-angular/app/app.component.ts`.\n\nIn addition to the plugin usage, both apps are webpack configured.\n\nIn short here are the steps:\n\n### Import the plugin\n\n*TypeScript*\n``` \nimport * as imagepicker from \"nativescript-imagepicker\";\n```\n\n*Javascript*\n``` \nvar imagepicker = require(\"nativescript-imagepicker\");\n```\n\n### Create imagepicker\n\nCreate imagepicker in `single` or `multiple` mode to specifiy if the imagepicker will be used for single or multiple selection of images\n\n*TypeScript*\n``` \nlet context = imagepicker.create({\n mode: \"single\" // use \"multiple\" for multiple selection\n});\n````\n\n*Javascript*\n````\nvar context = imagepicker.create({ mode: \"single\" }); // use \"multiple\" for multiple selection\n````\n\n### Request permissions, show the images list and process the selection\n\n``` \ncontext\n .authorize()\n .then(function() {\n return context.present();\n })\n .then(function(selection) {\n selection.forEach(function(selected) {\n // process the selected image\n });\n list.items = selection;\n }).catch(function (e) {\n // process error\n });\n```\n\n> **NOTE**: To request permissions for Android 6+ (API 23+) we use [nativescript-permissions](https://www.npmjs.com/package/nativescript-permissions).\n\n## API\n\n### Methods\n\n* create(options) - creates instance of the imagepicker. Possible options are:\n\n| Option | Platform | Default | Description |\n| --- | --- | --- | --- |\n| mode | both | multiple | The mode if the imagepicker. Possible values are `single` for single selection and `multiple` for multiple selection. |\n| doneText | iOS | Done | The text of the \"Done\" button on top right. |\n| cancelText | iOS | Cancel | The text of the \"Cancel\" button on top left. |\n| albumsText | iOS | Albums | The title of the \"Albums\" screen from where the selection of album and images can be done. |\n| newestFirst | iOS | false | Set to `true` to sort the images in an album by newest first. |\n\n* authorize() - request iOS specific permissions.\n* present() - show the albums to present the user the ability to select images. Returns an array of the selected images.\n* cancel() - cancel selection. iOS only.\n* done() - confirm the selection is ready. iOS only.\n\n\n### Properties\n| Property | Default | Description |\n| --- | --- | --- |\n| selection | null | An array of selected image assets. |\n| albums | null | Albums from where the images are picked. |\n\n\n### Image properties\n\nOnce image is picked some options can be applied to it before it is used:\n\n| Option | Default | Description |\n| --- | --- | --- |\n| maxWidth | null | Image max width |\n| maxHeight | null | Image max height |\n| aspectRatio | fit | iOS only. Possible values are `fit` and `fill`. [Read more](https://developer.apple.com/documentation/photos/phimagecontentmode) |\n\n## License\n\n2015, Telerik AD", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git+https://github.com/NativeScript/nativescript-imagepicker.git" }, "scripts": { "build": "npm i && tsc", "ci.tslint": "npm i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**'", "clean": "rm -rf node_modules && cd ../demo && rm -rf hooks node_modules platforms && cd ../src && npm run plugin.link", "demo.android": "npm i && npm run tsc && cd ../demo && tns run android --syncAllFiles", "demo.ios": "npm i && npm run tsc && cd ../demo && tns run ios --syncAllFiles", "ngc": "node --max-old-space-size=8192 ./node_modules/.bin/ngc", "plugin.link": "npm link && cd ../demo && npm link nativescript-imagepicker && cd ../demo-angular && npm link nativescript-imagepicker", "plugin.tscwatch": "npm run tsc -- -w", "postclone": "npm i && node scripts/postclone.js && cd ../demo && npm i && cd ../src && npm run plugin.link", "prepublishOnly": "npm run build", "test.android": "npm i && npm run tsc && npm run tslint && cd ../demo && tns build android && tns test android --justlaunch && cd ../demo-angular && tns build android && tns test android --justlaunch", "test.ios": "npm i && npm run tsc && npm run tslint && cd ../demo && tns build ios && tns test ios --justlaunch", "tsc": "tsc -skipLibCheck", "tslint": "cd .. && tslint \"**/*.ts\" --config tslint.json --exclude \"**/node_modules/**\"" }, "typings": "index.d.ts", "version": "4.0.1" }