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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mvc-works/codearea

v0.0.4

Published

Web app scaffold based on Webpack

Downloads

11

Readme

Codearea Script

Make <textarea/>s a bit like <codearea/>.

Usage

yarn add @mvc-works/codearea

Put the textareaEditor.js file in the <script> tag of your page. Suppose there's tag <textarea id='area'> here, use this in your .js file:

import { codearea } from "@mvc-works/codearea"

codearea(textareaElement)

# remove events
teardownCodearea(textareaElement)

Try here: http://repo.mvc-works.org/codearea/

Details

influenced shortcuts:

enter
tab
esc
backspace
quote
brackets

shift enter
shift tab

ctrl l
ctrl u
ctrl k
ctrl enter

ctrl shift enter
ctrl shift k
ctrl shift d
ctrl shift up
ctrl shift down

Use in Respo

It can be used in Respo Effects:

(defeffect
 effect-codearea
 ()
 (action el)
 (when (= action :mount) (let [target (.querySelector el ".codearea")] (codearea target))))

Notice: a bug that codearea does not emit enough input events.

Chinese Docs

上面JS的目标是给<textarea>标签增加基本的编程功能支持, 主要是一些快捷键, 模仿Sublime Text的功能, 还有自动补全括号和缩进, 具体可以到链接尝试, 在Chrome中运行测试运行正常, 主要是__获取光标位置的API__和__绑定键盘事件的API__有差别. 大致思路是用wrap_text函数将文本框内容包装成按列处理的对象, 之后通过事件触发map_keys选取对应的key_*函数处理对象的内容, 最后write_text将对象转化回到文本写入.

性能能再优化下, 不清楚对于长文本是否会有延迟, 目前还可以, departed_files是前期的代码, 有些历史文档, 但不再被维护.

License

MIT