Giter Club home page Giter Club logo

dxm-numbers's Introduction

简介:

这是我发布的第一个第三方库小demo,实现了简单的功能: 把1-5的数字转换成文本形式,也可以将英文的文本字符转换成1-5的数字 让我们一起学习造轮子吧。

此插件需要依赖lodash

请确保你的项目中已经安装了lodash

安装方式:

* npm的安装方式:
  1. 执行 npm i dxm-numbers,如果发生以下错误的话请执行第二步
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/webpack
npm ERR!   dev webpack@"^5.75.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^4.0.0" from [email protected]
npm ERR! node_modules/uglifyjs-webpack-plugin
npm ERR!   uglifyjs-webpack-plugin@"^2.2.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     D:\software\nodejs\node_cache\_logs\2023-01-11T11_27_42_026Z-debug-0.log
  1. 执行 npm i dxm-numbers --legacy-peer-deps
  2. 在页面中使用
import {numToWord,wordToNum} from 'dxm-numbers';
let res =  wordToNum('Five');
let res2 =  numToWord(1);

* script标签的方式引用
  <script src="/path/lodash.js"></script>
  <script src="/path/webpack-numbers.js"></script>
    let res =  myNumbers.wordToNum('Five');
    let res2 = window.myNumbers.wordToNum('Five');

dxm-numbers's People

Contributors

dengxm1 avatar

Stargazers

Somnus丶X 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.