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

popcorn-tools

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

popcorn-tools

[![Build Status](https://travis-ci.com/Popcorn-BR/popcorn-tools.svg?branch=master)](https://travis-ci.com/Popcorn-BR/popcorn-tools) [![Coverage Status](https://coveralls.io/repos/github/Popcorn-BR/popcorn-tools/badge.svg?branch=master)](https://coveralls.

  • 0.3.2
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Popcorn Tools

Build Status Coverage Status npm

Installation

$ npm install popcorn-tools --save

How to use

ES6

// to import a specific method
import popcorn from 'popcorn-tools';
// using  method
popcorn.measureFormat(1000);

UMD in Browser

<!-- to import non-minified version -->
<script src="popcorn-tools.umd.js"></script>

<!-- to import minified version -->
<script src="popcorn-tools.umd.min.js"></script>

After that the library will be available to the Global as PopcornTools. Follow an example:



const data = popcorn.measureFormat(1000);

Methods

Follow the methods that the library provides.

popcorn.measureFormat(value)

Format numbers according to the unit of measurement.

Arguments

ArgumentType
valuenumber

Example

const data = popcorn.measureFormat(1000);

popcorn.cpfValidate(cpf)

Valid if the number of a CPF (Individual Taxpayer Registration) is valid.

Arguments

ArgumentType
cpfstring

Example

const valid = popcorn.cpfValidate(cpf);

popcorn.mobileCheck()

checks if the browser is on a mobile device..

Example

const check = popcorn.mobileCheck();

popcorn.currencyFormat(data)

Format a number for the desired currency.

Arguments

ArgumentType
valuenumber
stylestring
currencystring

Example

  popcorn.currencyFormat({ currency: 'BRL', style: 'pt-BR', value: 10 })

popcorn.filter(array, value, param)

Filter an array of objects based on a string.

Arguments

ArgumentType
arrayarray
valuestring
paramstring

Example

const data = [
  { value: 'Banana' },
  { value: 'Maçã' },
  { value: 'Laranja' },
  { value: 'Morango' },
  { value: 'Abacaxi' },
  { value: 'Mamão' },
];
const dataFilter = popcorn.filter(data, 'mam', 'value');

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

Denner Rondinely
Denner Rondinely

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Keywords

FAQs

Package last updated on 23 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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