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

awg-editor

v1.1.1

Published

```bash npm i install awg-editor or yarn add awg-editor ```

Readme

awg-editor

🚄 使用教程

安装

  npm i install awg-editor or yarn add awg-editor

使用

import { AwgEditor } from 'awg-editor'
const editor = AwgEditor.getInstance()
AwgEditor.initSuggestions(funName) // 创建代码补全提示
AwgEditor.initHover(hoverHints) // 创建鼠标悬浮提示
AwgEditor.initCodeEditor(dom) // 初始化编辑器

📖 文档

Class: AwgEditor

基于monaco-editor的二次封装,实现快速定义自定义提示和鼠标悬浮提示

Implements

  • CodeEditor

Table of contents

Properties

Methods

Properties

hoverMap

Private hoverMap: Map<string, IMarkdownString[]>

internal

Defined in

AwgEditor.ts:9


hoverTips

Private hoverTips: null | IDisposable

Defined in

AwgEditor.ts:11


language

language: string

Implementation of

CodeEditor.language

Defined in

AwgEditor.ts:12


suggestion

Private suggestion: null | IDisposable

Defined in

AwgEditor.ts:10


instance

Static instance: AwgEditor

Defined in

AwgEditor.ts:13

Methods

defineTheme

defineTheme(): void

自定义编辑器主题,默认使用AWG项目的主题

Returns

void

Implementation of

CodeEditor.defineTheme

Defined in

AwgEditor.ts:46


dispose

dispose(): void

取消原有的自定义提示与鼠标悬浮提示

Returns

void

Implementation of

CodeEditor.dispose

Defined in

AwgEditor.ts:186


formateHover

formateHover(txt): string

提供简单的格式化鼠标悬浮提示的能力

Parameters

| Name | Type | Description | | :------ | :------ | :------ | | txt | string | 格式化文字 |

Returns

string

格式化后的文字

Defined in

AwgEditor.ts:179


initCodeEditor

initCodeEditor(editorDom): null | IStandaloneCodeEditor

初始化编辑器

Parameters

| Name | Type | Description | | :------ | :------ | :------ | | editorDom | HTMLElement | monaco-editor的dom容器 |

Returns

null | IStandaloneCodeEditor

monaco-editor create实例

Implementation of

CodeEditor.initCodeEditor

Defined in

AwgEditor.ts:195


initHover

initHover(params, formate?): void

初始化鼠标悬浮提示

Parameters

| Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | | params | HoverParams | HoverParams[] | undefined | 自定义鼠标悬浮提示参数 | | formate | boolean | true | 是否开启简单的提示格式化功能 |

Returns

void

Implementation of

CodeEditor.initHover

Defined in

AwgEditor.ts:126


initSuggestions

initSuggestions(params): void

初始化自定义函数提示

Parameters

| Name | Type | Description | | :------ | :------ | :------ | | params | string[] | SuggestionsParams[] | 自定义函数提示参数 |

Returns

void

Implementation of

CodeEditor.initSuggestions

Defined in

AwgEditor.ts:101


setLanguage

setLanguage(lan): void

Parameters

| Name | Type | Description | | :------ | :------ | :------ | | lan | string | 设置编辑器语言 |

Returns

void

Implementation of

CodeEditor.setLanguage

Defined in

AwgEditor.ts:40


getInstance

Static getInstance(): AwgEditor

return(awgeditor)

Returns

AwgEditor

Defined in

AwgEditor.ts:28