Tabnine Logo For Javascript
STYLE_NORMAL
Code IndexAdd Tabnine to your IDE (free)

How to use
STYLE_NORMAL
function
in
pinyin

Best JavaScript code snippets using pinyin.STYLE_NORMAL(Showing top 1 results out of 315)

origin: kslr/telegram-aqi-bot

bot.onText(/\/aqi (.+)/, (msg, match) => {
 let city = match[1];
 const re = /[^\u4e00-\u9fa5]|[\uFE30-\uFFA0]/;
 if (!re.test(city)) {
  city = pinyin(city, {
   segment: true,
   style: pinyin.STYLE_NORMAL,
  });
  city = city.join('');
 }

 console.log(`query ${city} city`);
 request(`http://aqicn.org/aqicn/json/android/${city}/json`, (error, response, body) => {
  if (!error && response.statusCode === 200) {
   const res = JSON.parse(body);
   if (res.wgt) {
    console.log(res.wgt);
    bot.sendPhoto(msg.chat.id, res.wgt);
   }
  } else {
   console.error(error);
  }
 });
});
pinyin(npm)STYLE_NORMAL

Most used pinyin functions

  • pinyin
  • STYLE_FIRST_LETTER

Popular in JavaScript

  • fs
  • yargs
    yargs the modern, pirate-themed, successor to optimist.
  • axios
    Promise based HTTP client for the browser and node.js
  • crypto
  • postcss
  • cheerio
    Tiny, fast, and elegant implementation of core jQuery designed specifically for the server
  • winston
    A logger for just about everything.
  • qs
    A querystring parser that supports nesting and arrays, with a depth limit
  • lodash
    Lodash modular utilities.
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now