npm

Join us for the "JavaScript Supply Chain Security" tech talk, presented by VP of Security, Adam Baldwin. 6/20 at 10am PT.Sign up here »

start-with

1.0.2 • Public • Published

start-with Version Badge

Determines whether a string begins with the characters of another string.

ES2015 String#startsWith() ponyfill.

Ponyfill: A polyfill that doesn't overwrite the native method.

MIT License

build:? coverage:?

Install

$ npm install --save start-with 

Usage

For more use-cases see the tests

var startWith = require('start-with');
 
startWith('abcde', 'a');  // => true
startWith('abcde', 'ab'); // => true
startWith('abcde', 'bc'); // => false
startWith('abcde', '');   // => true
startWith('abcde');       // => false
startWith('abcde', null); // => false
 

Related

  • end-with - Determines whether a string ends with the characters of another string.
  • pad-start - ES spec-compliant String.prototype.padStart shim.
  • pad-end - ES spec-compliant String.prototype.padEnd shim.

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.

install

npm i start-with

Downloadsweekly downloads

1,023

version

1.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability