Giter Club home page Giter Club logo

eutils's Introduction

项目介绍

该项目整理了前端比较常用的工具集,包括js工具和css工具; 当我们新建一个前端项目时,只需要引入这个npm包,就可以省去很多写工具的重复工作;

项目规范

  • 函数使用小驼峰方式命名
  • 对象使用大驼峰方式命名
  • 项目使用webpack构建,支持按需引入
  • 支持直接引入编译前的源文件:less文件、es6文件

安装

$ npm install @jnlong/eutils

使用

js

    // js引用方法1
    import eutils from 'eutils';

    eutils.date.format('2018-9-6', '{y}/{m}/{d} {h}:{i}:{s}');

    // js引用方法2
    import {type, urlParse, date, log as ulog} from 'eutils';
    date.format(new Date(), 'YYYY-MM-DD HH:mm:ss.SSS');

    // 按需引入js源文件
    import date as uDate from 'eutils/src/js/date'

style

    // 引入css
    @import 'eutils/dist/index.css';

    // 引入less:webpack需要配置less解析
    @import 'eutils/src/style/index.less';
    @import 'eutils/src/style/index.less';

用法

在 example/main.js中编写了每一个API的用法,可以打开文件查看。

example

可以运行样例查看example

  • git clone [email protected]:jnlong/eutils.git
  • cd eutils
  • npm install --save-dev
  • npm run dev
  • 用浏览器打开 http://localhost:8088/查看example,也可以同时打开浏览器的控制台查看console信息

参考

eutils's People

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.