Socket
Book a DemoInstallSign in
Socket

@asyncapi/generator-components

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@asyncapi/generator-components

Package with reusable components for generation using React render engine

latest
Source
npmnpm
Version
0.4.1
Version published
Weekly downloads
11K
-1.31%
Maintainers
3
Weekly downloads
 
Created
Source

"use strict";

Object.defineProperty(exports, "__esModule", { value: true }); exports.Usage = Usage; var _generatorReactSdk = require("@asyncapi/generator-react-sdk"); var _jsxRuntime = require("react/jsx-runtime"); var usageConfig = { python: function python(clientName, clientFileName) { return "\nfrom ".concat(clientFileName.replace('.py', ''), " import ").concat(clientName, "\n\nws_client = ").concat(clientName, "()\n\nasync def main():\n await ws_client.connect()\n # use ws_client to send/receive messages\n await ws_client.close()\n"); }, javascript: function javascript(clientName, clientFileName) { return "\nconst ".concat(clientName, " = require('./").concat(clientFileName.replace('.js', ''), "');\nconst wsClient = new ").concat(clientName, "();\n\nasync function main() {\n try {\n await wsClient.connect();\n // use wsClient to send/receive messages\n await wsClient.close();\n } catch (error) {\n console.error('Failed to connect:', error);\n }\n}\n\nmain();\n"); } }; function Usage(_ref) { var clientName = _ref.clientName, clientFileName = _ref.clientFileName, language = _ref.language; var snippetFn = usageConfig[language]; var snippet = snippetFn(clientName, clientFileName); return /#PURE/(0, _jsxRuntime.jsx)(_generatorReactSdk.Text, { newLines: 2, children: "## Usage\n\n".concat(language, "\n").concat(snippet.trim(), "\n\n") }); }

FAQs

Package last updated on 16 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts