npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@rustvk/emailsinput

v1.1.1

Published

Emails input field component

Downloads

11

Readme

Content

Compatibility

Library is compatible with Ecmascript 5th version.

IE11 | Chrome | Firefox | Safari | Edge

Install

Several quick start options are available:

Install with npm:

If you use NPM packages in your project the next way is right for you:

  • Run command
  npm i @rustvk/emailsinput
  • Add to your JS component:
  import '@rustvk/emailsinput/emails-input.min.js';
  import '@rustvk/emailsinput/emails-input.css';

Via sources:

  • Clone project or download sources to your computer

    Within the download you'll find the following directories and files:

EmailInput-master/
└── dist/
    ├── emails-input.min.js
    └── emails-input.css
├── src/
    └── EmailsInput
        ├── index.js
        └── style.css
├── index.html
├── style.css
├── webpack.config.js
└── package.json
  • Load dist / index.js и dist / style.css into your project
  • Include to your *.html file:
  ...
  <head>
    <link href="{path}/emails-input.css" rel="stylesheet" />
  </head>
  <body>
    ...
    <script src="{path}/emails-input.min.js"></script>
  </body> 
  ...

Usage

  • Create container for component with your ID
<body>
    ...
    <div id="emails-input"></div>
    ...
</body>
  • Add <script> tag before <body> closed
    <body>
        ...
        <script>
            var emailsInput = EmailsInput({
                container: document.querySelector('#emails-input')
            });
        </script>
    </body>
  • Add your width and height rules. By default width is 540px and height is 300px Default sizes will be ignored if #emails-input has a max-width and height style properties
  #emails-input {
    max-width: 600px;
    height: 400px;
  }

Documentation

Added script is create EmailsInput component function in your global object Window

EmailsInput get an object with options as an argument

list of options:

   @params {object} options
   @params {HTMLContainer} container - HTMLElement that will conaint EmailsInput component
   @params {string} [title] - Optional title for EmailsInput block
    

EmailsInput function return an object with methods:

/**
 * Adding email to field
 * @params {string} email
**/
addEmail: function() {...}

/**
 * Get emails count
 * @returns {string} String with valid and common emails count
**/
getCount: function() {...}