Coder Social home page Coder Social logo

defuj / def-helper Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 26 KB

A collection of functions and methods to make it easier for you to create applications.

Home Page: https://www.npmjs.com/package/def-helper

TypeScript 100.00%
functions hacktoberfest hacktoberfest2022 javascript methods react typescript vuejs

def-helper's Introduction

def-helper

A collection of functions and methods to make it easier for you to create applications.

NPM JavaScript Style Guide

Install

npm install --save def-helper

Usage

import {
  slugify,
  validateEmail,
  validatePhone,
  getNumberInFirstString,
  validateURL,
  imageUrlToBase64,
  getNumber,
  compareObject
} from 'def-helper'

const slug = slugify('Hello World')
// result will be "hello-world"

const email = validateEmail('[email protected]')
// result will be true

const phone = validatePhone('08123456789')
// result will be true

const number = getNumberInFirstString('17676-Hello 123 World')
// result will be 17676

const url = validateURL('https://google.com')
// result will be true

// imageUrlToBase64([url image -> convert to base64],[url image if url image target is error], (result base64) => {
//
// })
const base64 = imageUrlToBase64(
  'https://google.com/logo.png',
  'https://img.kpopmap.com/2018/07/mbc-rebel.jpg',
  (base64) => {
    // result will be base64 string
  }
)

const number = getNumber('17676-Hello 123 World')
// result will be 17676123

const compare = compareObject({ a: 1, b: 2 }, { a: 1, b: 2 })
// result will be true
const compare = compareObject({ a: 1, b: 2 }, { a: 1, b: 3 })
// result will be false

License

MIT © defuj

Contributor

Thanks to all amazing contributors

def-helper's People

Contributors

defuj avatar ihsanbudiman avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

ihsanbudiman

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.