Code Monkey home page Code Monkey logo

chinese-ts's Introduction

chinese-ts

🇨🇳 **的 javascript 工具集, 旨在帮助**人更方便更快捷的处理国内特有需求的 javascript 工具库.

这个库名称的由来: chinese 可以译为: '**的', ts 即 toolset 的缩写, 同时还因为它是使用 typescript 开发的.

查阅文档

安装

  • 使用 npm 安装
npm install chinese-ts
  • 使用 pnpm 安装
pnpm add chinese-ts
  • 使用 yarn 安装
yarn add chinese-ts
  • 国内还可以使用 cnpm 安装
cnpm install chinese-ts

使用

CDN 方式

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script src="https://unpkg.com/chinese-ts/dist/index.iife.js"></script>
    <script>
      CHINESE_TS.getCityAlias('北京'); // => '京'
    </script>
  </body>
</html>

ESM 方式

import { getCityAlias } from 'chinese-ts';
getCityAlias('北京'); // => '京'

CJS 方式

const { getCityAlias } = require('chinese-ts');
getCityAlias('北京'); // => '京'

计划与支持

字符串

计划 支持
判断是否包含中文字符串
判断是否只有中文字符串

手机号

计划 支持
判断是否为**手机号

农历

数据来源于香港天文台(1900-2100 年), 相关方法依赖于第三方库 calendar

计划 支持
获取今天的农历日期
获取指定公历日期的农历日期
计算公历日期与农历日期相差多少天 🚧
获取今年法定节假日 🚧

省份

计划 支持
根据省份名称获取简称
获取所有省份名称简称

协议

MIT

chinese-ts's People

Contributors

hacxy avatar

Watchers

 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.