Giter VIP home page Giter VIP logo

tui.code-snippet's Introduction

TOAST UI Tools: Code Snippet

Group of utility methods to make ease with developing javascript applications.

GitHub release npm GitHub license PRs welcome code with hearth by NHN

🚩 Table of Contents

πŸ“™ Documents

You can also see the older versions of API page on the releases page.

🎨 Features

  • ajax
    • Send the Ajax request
  • array
    • Handle arrays
  • browser
    • Detect browser
  • collection
    • Process collections
    • Support util methods for collections
  • customEvents
    • Add/Remove/fire custom events
  • defineClass
    • Define classes
  • domEvent
    • Add, remove, fire DOM events
    • Control mouse events
  • domUtil
    • Control the information of DOM
    • Add, remove, find DOM class name
  • enum
    • Manage constant value
    • Make immutability values but IE8 low
  • formatDate
    • Format date strings
  • inheritance
    • Simple inheritance (Nicholas C. Zakas, YUI Library)
    • Call supur constructor of superclass
    • Have to get inheritance before define child
    • Use mixin and inner object
  • object
    • Support utils to control object
  • request
    • Request image ping
  • string
    • Support utils such as decodeHTMLEntity, encodeHTMLEntity
  • tricks
    • Creates a debounced function and a throttled function
  • type
    • Check data type

πŸ’Ύ Install

TOAST UI products can be used by using the package manager or downloading the source directly. However, we highly recommend using the package manager.

Via Package Manager

TOAST UI products are registered in two package managers, npm. You can conveniently install it using the commands provided by each package manager. When using npm, be sure to use it in the environment Node.js is installed.

npm

$ npm install --save tui-code-snippet # Latest version
$ npm install --save tui-code-snippet@<version> # Specific version

Download Source Files

πŸ”¨ Usage

Import only functions that you need in your code:

// CommonJS
const func = require('tui-code-snippet/<folder>/<function>');

// for example,
const inArray = require('tui-code-snippet/array/inArray');
const customEvents = require('tui-code-snippet/customEvents/customEvents');
// ES6
import func from 'tui-code-snippet/<folder>/<function>';

// for example,
import inArray from 'tui-code-snippet/array/inArray';
import customEvents from 'tui-code-snippet/customEvents/customEvents';

The folder structure can be found here.

Bundle

Since v2.0, it does not provide bundle files. If you need a bundle file, you should make it yourself using the command npm run bundle.

$ git clone https://github.com/nhn/tui.code-snippet.git
$ cd tui.code-snippet
$ npm install
$ npm run bundle

After executing npm run bundle, the uncompressed(tui-code-snippet.js) and minified(tui-code-snippet.min.js) files are created in the dist folder.

tui.code-snippet/
β”œβ”€ dist
β”‚  β”œβ”€ tui-code-snippet.js
β”‚  β”œβ”€ tui-code-snippet.min.js
β”œβ”€ ...

The entry file is index.js. When you do not modify index.js, all methods of tui.code-snippet will be included in the bundle file. To bundle the methods you need, remove other methods in the entry file.

// index.js
// for example, you need inArray, forEach and isArray methods only.
require('./array/inArray');
require('./collection/forEach');
require('./type/isArray');

🌏 Browser Support

Chrome Chrome IE Internet Explorer Edge Edge Safari Safari Firefox Firefox
Yes 8+ Yes Yes Yes

πŸ”§ Pull Request Steps

TOAST UI products are open source, so you can create a pull request(PR) after you fix issues. Run npm scripts and develop yourself with the following process.

Setup

Fork master branch into your personal repository. Clone it to local computer. Install node modules. Before starting development, you should check if there are any errors.

$ git clone https://github.com/{your-personal-repo}/tui.code-snippet.git
$ cd tui.code-snippet
$ npm install
$ npm run test

Develop

Let's start development! Don't miss adding test cases and then make green rights.

Running test

$ npm run test

Pull Request

Before uploading your PR, run test one last time to check if there are any errors. If it has no errors, commit and then push it!

For more information on PR's steps, please see links in the Contributing section.

πŸ’¬ Contributing

🍞 TOAST UI Family

πŸ“œ License

This software is licensed under the MIT License Β© NHN.

tui.code-snippet's People

Contributors

johnny-mh avatar minhyeong-kim avatar seonim-ryu avatar heenakwag avatar icebelle avatar youjung-hong avatar extremefe avatar jajugoguma avatar jinwoo-kim-nhn avatar jkeen avatar kyuwoo-choi avatar dependabot[bot] avatar dungsil avatar sohee-lee7 avatar

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.