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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@babytian/openinula-repl-next

v0.0.1

Published

> "读取-求值-输出"循环(英語:Read-Eval-Print Loop,简称REPL),也被称做交互式顶层构件

Readme

openinula-repl-next

"读取-求值-输出"循环(英語:Read-Eval-Print Loop,简称REPL),也被称做交互式顶层构件

本组件是提供一个 关于openinula的 交互式编程环境组件

Installation

npm i openinula-repl

Usage

function App() {
  return (
    <Repl
      name="inula-playground"
      split={{ split: 'vertical' }}
    >
      <Editor />
      <Viewer />
    </Repl>
  );
}

自定义演示示例

您可以为Repl或Editor组件提供自定义的演示示例: 当前支持导入Preview、SourceMap、Output、Components组件,Viewer是对这四个的整合,同时生成导航栏,可按需导入

import { Repl, Editor, Preview, Output, SourceMap, Components, Viewer } from 'openinula-repl-next'

在Repl组件级别使用

import { Repl } from 'openinula-repl';
import type { DemoItem } from 'openinula-repl';

// 自定义基础演示
const customBasicDemos: DemoItem[] = [
  {
    concept: "自定义Hello World",
    emoji: "🌍",
    description: "一个自定义的Hello World示例",
    code: `
import { createSignal } from 'openinula';

function App() {
  const [message] = createSignal('Hello from Custom Demo!');
  
  return (
    <div>
      <h1>{message()}</h1>
      <p>这是一个自定义的基础演示示例</p>
    </div>
  );
}

export default App;
    `.trim()
  }
];

// 自定义高级演示
const customAdvancedDemos: DemoItem[] = [
  {
    concept: "自定义Context",
    emoji: "📦",
    description: "一个自定义的Context示例",
    code: `
import { createContext, useContext, createSignal } from 'openinula';

const ThemeContext = createContext();

function ThemeProvider({ children }) {
  const [theme, setTheme] = createSignal('light');
  
  return (
    <ThemeContext.Provider value={{ theme: theme(), setTheme }}>
      {children}
    </ThemeContext.Provider>
  );
}

function App() {
  return (
    <ThemeProvider>
      <div>
        <h1>自定义Context示例</h1>
      </div>
    </ThemeProvider>
  );
}

export default App;
    `.trim()
  }
];

function App() {
  return (
    <Repl 
      name="custom-demo-playground"
      advancedDemos={customAdvancedDemos}
      basicDemos={customBasicDemos}
    >
      <Editor />
      <Viewer />
    </Repl>
  );
}

在Editor组件级别使用

import { Repl, Editor } from 'openinula-repl';
import type { DemoItem } from 'openinula-repl';

// 自定义演示数组...

function App() {
  return (
    <Repl name="custom-demo-playground">
      <Editor 
        advancedDemos={customAdvancedDemos}
        basicDemos={customBasicDemos}
      />
      <Viewer />
    </Repl>
  );
}

API

|属性|说明|类型|默认值| |---|---|---|---| |name|repl的名称|string|| |split|设置编辑器和查看器的布局|SplitPaneProps|| |className|自定义类名|string|| |code|初始代码|string|| |defaultCode|默认代码|string|| |importMap|import map配置|string|| |placeHolder|编辑器placeholder|string|| |enableStorage|是否启用本地存储|boolean|| |children|子组件|InulaNode|Editor 和 Viewer| |advancedDemos|自定义高级演示数组|DemoItem[]|默认高级演示| |basicDemos|自定义基础演示数组|DemoItem[]|默认基础演示|

Editor组件额外属性

| 属性 | 说明 | 类型 | 默认值 | | ------------- | -------------------- | ------------------- | -------------- | | darkTheme | 是否使用深色主题 | boolean | false | | className | 自定义类名 | string | | | Menu | 自定义菜单组件 | React.ComponentType | 暂存 bug,不建议使用 | | advancedDemos | 自定义高级演示数组 | DemoItem[] | 默认高级演示 | | basicDemos | 自定义基础演示数组 | DemoItem[] | 默认基础演示 |

DemoItem类型

interface DemoItem {
  concept: string;    // 演示概念名称
  emoji: string;      // 演示图标
  description: string; // 演示描述
  code: string;       // 演示代码
}