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

@huawei-ide/codearts

v1.0.32

Published

用于集成 CodeArts IDE Web

Downloads

603

Readme

@huawei-ide/codearts

用于集成 CodeArts IDE Web

如何使用

  1. 安装 @huawei-ide/codearts
    npm install @huawei-ide/codearts

  2. 引入 @huawei-ide/codearts
    const ide = require('@huawei-ide/codearts');

  3. 预加载 IDE, 返回 Promise:
    await ide.preload();

  4. 展示 IDE
    其中 id 参数为挂载节点 id, 返回 Promise: ide.show(id: string, {width:string,height: string}).then(() => {});

  5. 打开文件,默认可编辑
    参数 content 为文件内容,类型为 string,path 是工程内文件的唯一路径,例如'src', 'src/tool', name 为带后缀的文件名:

    ide.openFile({
         content: '## ReadME',
         path:'src',
         name: 'README.md'
     });

    如果需要传入pdf文件,content需要设置为空,path为pdf资源链接,name为pdf文件名。

  6. 设置文件是否为预览(只读)状态
    ide.setPreview(preview: boolean)

  7. 获取当前文件最新内容,返回 Promise:
    await ide.getContent();

  8. 设置 DomainId 及 UserId:
    ide.setUserId(domainId: string, userId: string);

  9. 监听当前文件变化

    const event = ide.onDidChange(listener: (content: string) => {});
    // 销毁监听
    event.dispose();
  10. 设置图片、文件前缀:
    ide.setImgPrefix(prefix: string);
    ide.setFilePrefix(prefix: string);

  11. 设置Mardown文件中iframe的source:
    ide.setIframeOrigin(origin: string);

  12. 设置深色/浅色主题:
    ide.setColorTheme(theme: string);

// 深色
ide.setColorTheme('dark');
// 浅色
ide.setColorTheme('light');
  1. 销毁 IDE
    ide.dispose();