npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

vscode-intl-javascript

v0.1.7

Published

vscode intl plugin

Readme

How to use it

Search vscode-intl-javascript in vscode Market, then install it

Simple start (react)

create config file in project dir

intl.config.js

install package

npm install vscode-intl-javascript react-intl-universal --save-dev

write config content

const ReactBabel = require('vscode-intl-javascript/out/plugins/react');
const ReactIntlUniversal = require('vscode-intl-javascript/out/plugins/react-intl-universal');
module.exports = (parser) => {
    return {
        langs: [
            {
                key: 'zh_CN',
                name: '中文简体'
            },
            {
                key: 'en_US',
                name: '英文'
            }
        ],
        plugins: [
            new ReactIntlUniversal({
                defaultLang: 'zh_CN',
                defaultFuncNameReg: /d/,
                getFuncNameReg: /get|getHTML/
            }),
            new ReactBabel()
        ]
    }
}

Example

example

Usage display

basic usage

basic usage

replace already key

replace already key

replace no right key

replace no right key

replace no right value

replace no right value

batch check dir

batch check dir

Framework

Framework

Config

langs [array]

{
    key: LangKey, // International file name
    name: string, // Prompt text
    color: string, // Prompt color when conditions are not met
    check: boolean, // Whether to skip batch detection
}[]
type LangKey = 'zh_CN' | 'en_US' | 'zh_TW';

localeDir

International file storage location

plugins

plug in mode 1

class ReactIntlUniversal {
    apply(parser) {
        // ...
    }
}
new ReactIntlUniversal({
    defaultLang: 'zh_CN',
    defaultFuncNameReg: /d/,
    getFuncNameReg: /get|getHTML/
})

plug in mode 2

// npm package : vscode-intl-javascript-plugin-XXX
export default class ReactIntlUniversal {
    apply(parser) {
        // ...
    }
}

[require.resolve('vscode-intl-javascript-plugin-XXX'), {
    optionA: 'XXX',
}]

How to write a plugin

clone plugin template from github vscode-intl-javascript-plugin-template

// just reference the code in src/plugins
export default class {
    apply(parser) {
        //...
    }
}

Parser API

filepath

current parse file path

babelHooks

babelPresetHook [SyncWaterfallHook]

export default class {
    apply(parser) {
        parser.babelHooks.babelPresetHook.tap((presets) => {
            return presets.concat([...]);
        })
    }
}

babelPluginHook [SyncWaterfallHook]

webViewHooks

public webViewHooks: {
    htmlHook: AsyncSeriesWaterfallHook<[string]>, // webview html content
    titleHook: AsyncSeriesWaterfallHook<[string]>, // webview title
    headHook: AsyncSeriesWaterfallHook<[string[]]>, // webview head tag list
    jsHook: AsyncSeriesWaterfallHook<[string[]]>, // webview head javascript tag list
    metaHook: AsyncSeriesWaterfallHook<[string[]]>, // webview head meta tag list
    cssHook: AsyncSeriesWaterfallHook<[string[]]>, // webview css tag list
    bodyHtmlHook: AsyncSeriesWaterfallHook<[string[]]>, // webview body html list
    btnHook: AsyncSeriesWaterfallHook<[string[]]>, // webview button list
    bodyHeaderJsHook: AsyncSeriesWaterfallHook<[string[]]>,// webview body jsvascript list, before </body>
    bodyFooterJsHook: AsyncSeriesWaterfallHook<[string[]]>, // webview body jsvascript list, after <body>
    listenerHook: AsyncSeriesWaterfallHook<[WebviewListenerParams[]]>, // webview listener callback list
    sendLangInfoHook: AsyncSeriesWaterfallHook<[MessageInfoSendParams, BaseErrorNode, Parser?]>, // webview postmessage params
    vueHooks: {
        createdHook: AsyncSeriesWaterfallHook<[string[][]]>, // webview vue create event callbacks
        methodsHook: AsyncSeriesWaterfallHook<[WebviewListenerParams[]]>, // webview vue methods property
    }
}

intlStorage

updateKeyInLang(param: UpdateParam): void;
checkKeyInLang(key: string, lang: LangKey, text?: string): {
    exist: boolean;
    ananimous: boolean;
};
getValueKeyInLang(value: string, lang: LangKey): string | null;
checkKey(key: string, text?: string): CheckResult;
getValueKey(value: string): CheckResult;
storeKeyAndValues(addParams: StorageAddParams[]): Promise<void>;
writeLangKeysToFile(langLey: LangKey, keys: {
    [key: string]: string;
}, isWhoile?: boolean): void;
storeKeyAndValue(addParam: StorageAddParams): void;
getKeyInLang(key: string, lang: LangKey): string;

config

localeDir: string
getFirstLangKey(): LangKey;
getTempDir(configFile: string | null): Promise<string>; // temp file dir

register new service

registerService(serviceName: keyof ParserService, serviceObj: any): void;
getService<T extends keyof ParserService>(serviceName: T): ParserService[T];

Plugin list

built-in plugins

react babel parser plugin

const ReactBabel = require('vscode-intl-javascript/out/plugins/react');
// file: intl.config.js
plugins: [
    new ReactIntlUniversal({
        defaultLang: 'zh_CN',
        defaultFuncNameReg: /d/,
        getFuncNameReg: /get|getHTML/
    }),
    new ReactBabel(),
]

react-intl-universal

const ReactIntlUniversal = require('vscode-intl-javascript/out/plugins/react-intl-universal');
// file: intl.config.js
plugins: [
    new ReactIntlUniversal({
        defaultLang: 'zh_CN',
        defaultFuncNameReg: /d/,
        getFuncNameReg: /get|getHTML/
    }),
    new ReactBabel(),
]

other plugins

alibaba(It can only be used inside the company)

plan

  • [ ] vue plugin
  • [ ] angular plugin
  • [ ] more hooks

communication

group dingding(钉钉群): 32965438