Socket
Socket
Sign inDemoInstall

nativescript-vibrate

Package Overview
Dependencies
0
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.1 to 2.0.2

README.es.md

23

package.json
{
"name": "nativescript-vibrate",
"version": "2.0.1",
"version": "2.0.2",
"description": "A vibrate NativeScript plugin for Android and iOS",

@@ -26,3 +26,4 @@ "main": "vibrate",

"clean": "cd ../demo && rimraf hooks node_modules platforms && cd ../src && rimraf node_modules && npm run plugin.link",
"ci.tslint": "npm i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**'"
"ci.tslint": "npm i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**'",
"prepare": "node scripts/prepare.js"
},

@@ -42,15 +43,17 @@ "keywords": [

},
"repository": {
"type": "git",
"url": "git://github.com/bazzite/nativescript-vibrate.git"
},
"license": "MIT",
"homepage": "https://github.com/bazzite/nativescript-vibrate",
"homepage": "https://www.bazzite.com/docs/nativescript-vibrate",
"readmeFilename": "README.md",
"peerDependencies": {
"tns-core-modules": "^3.0.0"
},
"devDependencies": {
"tns-core-modules": "^3.1.0",
"tns-platform-declarations": "^3.1.0",
"typescript": "~2.3.0",
"prompt": "^1.0.0",
"rimraf": "^2.5.0",
"tslint": "^5.0.0"
"semver": "^5.5.0",
"tns-core-modules": "^3.3.0",
"tns-platform-declarations": "^3.3.0",
"tslint": "^5.0.0",
"typescript": "~2.3.0"
},

@@ -57,0 +60,0 @@ "dependencies": {},

@@ -1,8 +0,6 @@

[![Bazzite Project](https://img.shields.io/badge/Bazzite-project-blue.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA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IiBmaWxsPSIjRkZGRkZGIiBwb2ludHM9IjQyLjYxLDc2Ljc2NCAxNTIuNTEsNDguMTM1IDE1Mi4zOTgsMC40NjcgMC45MDksMC42NjEgCQkJCSIvPg0KCQkJPC9nPg0KCQkJPGcgaWQ9IkNsaXBwZWRfOV8iIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE1MS4wMDAwMDAsIDIxNC4wMDAwMDApIj4NCgkJCQk8cG9seWxpbmUgaWQ9IlNoYXBlXzlfIiBmaWxsPSIjRkZGRkZGIiBwb2ludHM9IjEwOC45ODYsNzYuMzIzIDAuMTk4LDQ4LjEzNyAwLjA4OCwwLjQ2OSAxNTIuNjkxLDAuMjc1IAkJCQkiLz4NCgkJCTwvZz4NCgkJCTxnIGlkPSJDbGlwcGVkXzEwXyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTEwLjAwMDAwMCwgMC4wMDAwMDApIj4NCgkJCQk8cG9seWdvbiBpZD0iU2hhcGVfMTBfIiBmaWxsPSIjRkZGRkZGIiBwb2ludHM9IjAuMTIzLDAuNjAzIDE1MC4wNzcsMjkwLjMyMyAxOTMuNjkxLDIxNC4yNzUgODMuMjQ1LDAuNDk4IAkJCQkiLz4NCgkJCTwvZz4NCgkJPC9nPg0KCTwvZz4NCjwvZz4NCjwvc3ZnPg0K)](https://github.com/bazzite/nativescript-vibrate)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/a40541d66db746bcb6669b7f30fd498d)](https://www.codacy.com/app/bazzite/nativescript-vibrate?utm_source=github.com&utm_medium=referral&utm_content=bazzite/nativescript-vibrate&utm_campaign=badger)
[![Build status](https://ci.appveyor.com/api/projects/status/9lmje8p5or25qnpb?svg=true)](https://ci.appveyor.com/project/juliomrqz/nativescript-vibrate)
[![Travis](https://img.shields.io/travis/bazzite/nativescript-vibrate.svg)](https://travis-ci.org/bazzite/nativescript-vibrate)
[![David](https://img.shields.io/david/bazzite/nativescript-vibrate.svg)](https://david-dm.org/bazzite/nativescript-vibrate)
[![David](https://img.shields.io/david/dev/bazzite/nativescript-vibrate.svg)](https://david-dm.org/bazzite/nativescript-vibrate)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/bazzite/nativescript-vibrate/develop/LICENSE)
[![Bazzite Project](https://img.shields.io/badge/Bazzite-project-blue.svg?style=flat-square)](https://www.bazzite.com/docs/nativescript-vibrate?utm_source=github&utm_medium=readme&utm_campaign=nativescript-vibrate)
[![Codacy Badge](https://img.shields.io/codacy/grade/a40541d66db746bcb6669b7f30fd498d.svg?style=flat-square)](https://www.codacy.com/app/bazzite/nativescript-vibrate?utm_source=github.com&utm_medium=referral&utm_content=bazzite/nativescript-vibrate&utm_campaign=badger)
[![Travis](https://img.shields.io/travis/bazzite/nativescript-vibrate/master.svg?style=flat-square)](https://travis-ci.org/bazzite/nativescript-vibrate)
[![version](https://img.shields.io/npm/v/nativescript-vibrate.svg?style=flat-square)](https://www.npmjs.com/package/nativescript-vibrate)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://www.bazzite.com/docs/nativescript-vibrate/license?utm_source=github&utm_medium=readme&utm_campaign=nativescript-vibrate)

@@ -13,2 +11,4 @@ # NativeScript Vibrate

*Read this in other languages: [English](README.md), [Español](README.es.md)*
## Installation

@@ -18,10 +18,8 @@

```
```bash
$ tns plugin add nativescript-vibrate
```
This command automatically installs the necessary files, as well as stores nativescript-texttospeech as a dependency in your project's package.json file.
This command automatically installs the necessary files, as well as stores **nativescript-vibrate** as a dependency in your project's **package.json** file.
Due to a current open issue with NativeScript, [#669](https://github.com/NativeScript/nativescript-cli/issues/669), the plugin needs to be added before adding any platforms with the `tns add platform` command.
## Permissions

@@ -37,3 +35,3 @@

## Usage
## Example of use

@@ -47,3 +45,3 @@ To use the vibrate module you must first `require()` it:

If you use Typescript, you can require it this way:
If you use Typescript, you can import it this way:

@@ -62,2 +60,9 @@ ```typescript

If you prefer to use a vibration pattern, you could try:
```js
// my-page.js
vibrator.vibrate([1000, 300, 500, 2000]);
```
### Notes

@@ -67,30 +72,45 @@

There is no API to vibrate for a specific amount of time, so it will vibrate for the default no matter what (the duration is ignored).
There is no API to vibrate for a specific **amount of time** or **vibration pattern**, so it will vibrate for the default period of time no matter what.
## API
## Development setup
For easier development and debugging purposes continue with the following steps:
Only one method is available: `vibrate().` Below are all the supported properties you can play around.
1. Open a command prompt/terminal, navigate to `src` folder and run `npm run demo.ios` or `npm run demo.android` to run the demo.
2. Open another command prompt/terminal, navigate to `src` folder and run `npm run plugin.tscwatch` to watch for file changes in the plugin.
| Property | Default | Description | Android | iOS |
| :-: | :-: | :-: | :-: | :-: |
| time | 300 | The number of milliseconds to vibrate. It can be also an array of longs of times for which to turn the vibrator on or off. | ✔︎ | ✘ |
| repeat | -1 | The index into pattern at which to repeat, or -1 if you don't want to repeat. | ✔︎ | ✘ |
Now go and make a change to the plugin. It will be automatically applied to the demo project.
## Documentation & Support
If you want extra details of how to configure and use this plugin, the full documentation is available at [https://www.bazzite.com/docs/nativescript-vibrate][documentation].
### Unittesting
Open `demo/app/tests/tests.js` and adjust its contents so the tests become meaningful in the context of the plugin and its features.
For questions and support, use the [Issues section][issues].
You can read more about this topic [here](https://docs.nativescript.org/tooling/testing).
You may also want to [follow the company supporting this project on Twitter][twitter].
Once you're ready to test the plugin's API go to `src` folder and execute one of these commands:
### Commercial Support
```
npm run test.ios
npm run test.android
```
This project is sponsored by [Bazzite][bazzite-website]. If you require assistance on your project(s), please contact us at [https://www.bazzite.com/contact][contact-page].
### Clean plugin and demo files
## Contributing
Sometimes you may need to wipe away the `node_modules` and `demo/platforms` folders to reinstall them fresh.
Please make sure to read the [Contributing Guide][contributing] before making a pull request.
1. Run `npm run clean` to wipe those clean then you can can run `npm i` to install fresh dependencies.
## Code of Conduct
Everyone participating in this project is expected to agree to abide by the [Code of Conduct][code-of-conduct].
## License
Code released under the [MIT License][license-page].
[documentation]: https://www.bazzite.com/docs/nativescript-vibrate?utm_source=github&utm_medium=readme&utm_campaign=nativescript-vibrate
[contributing]: https://www.bazzite.com/docs/nativescript-vibrate/contributing?utm_source=github&utm_medium=readme&utm_campaign=nativescript-vibrate
[code-of-conduct]: https://www.bazzite.com/open-source/code-of-conduct?utm_source=github&utm_medium=readme&utm_campaign=nativescript-vibrate
[issues]: https://github.com/bazzite/nativescript-vibrate/issues
[twitter]: https://twitter.com/BazziteTech
[bazzite-website]: https://www.bazzite.com?utm_source=github&utm_medium=readme&utm_campaign=nativescript-vibrate
[contact-page]: https://www.bazzite.com/contact?utm_source=github&utm_medium=readme&utm_campaign=nativescript-vibrate
[license-page]: https://www.bazzite.com/docs/nativescript-vibrate/license?utm_source=github&utm_medium=readme&utm_campaign=nativescript-vibrate

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc