🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

every-index-of

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

every-index-of

Returns every index o a given character in an string.

latest
Source
npmnpm
Version
1.2.1
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

every-index-of

Simple piece of code tha returns every occurence of a single character in a string by it index.

Installation

$ npm install every-index-of

Usage

var evrIndex = require('every-index-of');

let all;

evrIndex('m', 'Common', (err, indexes)=>{
	if (err) { throw err; }

	all = indexes;
})

Should return an array like so:

[2, 3]

#Or the case sensitive vertion:

var evrIndex = require('every-index-of');

let all;

evrIndex('M', 'Common', true, (err, indexes)=>{
    if (err) { throw err; }

    all = indexes;
})

Should return:

-1

Features

  • Case insensetive
  • return -1 if there are no occurences

Keywords

all

FAQs

Package last updated on 28 Nov 2016

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