Method and device for accessing node.js package, and electronic device

By generating JavaScript files and storage paths to integrate with the low-code development platform, the problem of needing to redeploy Node.js package version updates is solved, achieving efficient version management.

CN115437656BActive Publication Date: 2026-04-2858 CHANG LIFE (BEIJING) INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
58 CHANG LIFE (BEIJING) INFORMATION TECH CO LTD
Filing Date
2022-08-30
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

When integrating Node.js packages into a low-code development platform, version updates require redeployment, which is time-consuming and labor-intensive.

Method used

By obtaining the target information of the Node.js package, JavaScript files and storage paths are generated and stored in the database. These files are then used to connect to the low-code development platform at runtime, avoiding direct access to the Node.js package.

Benefits of technology

When the Node.js package version changes, only the target information needs to be updated, without the need for redeployment, which improves efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115437656B_ABST
    Figure CN115437656B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a method and device for accessing a Node.js package, and an electronic device. The method is applied to a low-code development platform, and includes: obtaining target information of a Node.js package to be accessed, the Node.js package including at least one component; based on the target information, obtaining the Node.js package; for each component in the Node.js package, generating a JavaScript file and a storage path for accessing the low-code development platform; storing the JavaScript file and the storage path in a database; and based on the storage path in the database, accessing the JavaScript file to the low-code development platform in a case where the Node.js package is running. In embodiments of the present application, a JavaScript file is used to replace a Node.js package when accessing the Node.js package, and the access to the Node.js package can be indirectly implemented. Therefore, in a case where a version of the Node.js package is changed, only the target information needs to be re-input in the low-code development platform, and the Node.js package does not need to be re-deployed and put online, thereby saving time and effort.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer network technology, and in particular to a method, apparatus, and electronic device for accessing Node.js packages. Background Technology

[0002] Low-code development platforms are platforms that allow for the rapid generation of applications with little to no coding. During project development on low-code platforms, NPM (Node Package Manager) is typically used to manage Node.js packages. NPM, a Node.js package management and distribution tool, has become the unofficial standard for publishing Node modules (packages). This inevitably involves integrating Node.js packages.

[0003] Currently, Node.js packages are typically integrated using the package.json file of a project within a low-code development platform. Alternatively, the relevant code can be written directly within the project codebase to achieve this integration.

[0004] However, regardless of which method is used to integrate the Node.js package, if the version of the Node.js package is updated, it needs to be redeployed on the low-code development platform, which is time-consuming and laborious. Summary of the Invention

[0005] In view of the above problems, embodiments of the present invention are proposed to provide a method, apparatus, and electronic device for accessing Node.js packages that overcomes or at least partially solves the above problems.

[0006] In a first aspect, embodiments of the present invention provide a method for accessing Node.js packages, applied to a low-code development platform, the method comprising:

[0007] Obtain the target information of the Node.js package to be connected, wherein the target information includes the source address and the Node.js package includes at least one component;

[0008] Based on the target information, obtain the Node.js package;

[0009] For each component in the Node.js package, generate a JavaScript file and storage path for accessing the low-code development platform;

[0010] Store the JavaScript file and its storage path in the database;

[0011] When the Node.js package is running, the JavaScript file is connected to the low-code development platform based on the storage path in the database.

[0012] Optionally, the target information may further include: a target version number;

[0013] The step of obtaining the Node.js package based on the target information includes:

[0014] Based on the source address of the Node.js package, obtain the version of the Node.js package indicated by the target version number from a third-party server;

[0015] The third-party server pre-stores multiple versions of the Node.js package, and different versions of the Node.js package have different version numbers.

[0016] Optionally, for each component in the Node.js package, a JavaScript file and storage path for accessing the low-code development platform are generated, including:

[0017] Extract each component from the Node.js package;

[0018] For each of the aforementioned components, the components are repackaged to generate JavaScript files and storage paths for accessing the low-code development platform based on requests.

[0019] Optionally, the low-code development platform pre-stores a configuration table, in which a path is set for each component;

[0020] The storage path generated for the component is the path corresponding to the component in the configuration table.

[0021] Optionally, when running the Node.js package, connecting the JavaScript file to the low-code development platform based on the storage path in the database includes:

[0022] When the target page is displayed, the storage path in the database is obtained; wherein, the target page is the page of the low-code development platform used for setting up project configuration;

[0023] Based on the storage path, the JavaScript file is connected to the low-code development platform.

[0024] Optionally, after connecting the JavaScript file to the low-code development platform based on the storage path, the method further includes:

[0025] The target page displays the controls corresponding to each of the JavaScript files.

[0026] Upon receiving input for a target control, the JavaScript file corresponding to the target control is integrated into the currently running project of the low-code development platform, wherein the target control is any control corresponding to the JavaScript file.

[0027] Secondly, embodiments of the present invention also provide an apparatus for accessing Node.js packages, applied to a low-code development platform, the apparatus comprising:

[0028] The input module is used to obtain the target information of the Node.js package to be accessed, wherein the target information includes the source address and the Node.js package includes at least one component;

[0029] The acquisition module is used to acquire the Node.js package based on the target information;

[0030] A generation module is used to generate JavaScript files and storage paths for accessing the low-code development platform for each component in the Node.js package.

[0031] The storage module is used to store the JavaScript file and its storage path in the database;

[0032] The access module is used to access the JavaScript file to the low-code development platform based on the storage path in the database when the Node.js package is running.

[0033] Optionally, the target information may further include: a target version number;

[0034] The acquisition module is specifically used to obtain the version of the Node.js package indicated by the target version number from a third-party server based on the source address of the Node.js package;

[0035] The third-party server pre-stores multiple versions of the Node.js package, and different versions of the Node.js package have different version numbers.

[0036] Thirdly, embodiments of the present invention also provide an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the method for accessing the Node.js package as described above.

[0037] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in the method for accessing the Node.js package as described above.

[0038] In this embodiment of the invention, after receiving the target information of the Node.js package to be connected from the user's input, the target information includes the source address, thus allowing the identification of the Node.js package. Then, for each component in the Node.js package, a JavaScript file and storage path for connecting to the low-code development platform are generated. This process transforms the components in the Node.js package into JavaScript files and storage paths that can be directly connected to the low-code development platform, instead of directly connecting to the Node.js package itself. The JavaScript files and storage paths are first stored in a database, and then, while the Node.js package is running, data is read from the database to achieve the connection of the JavaScript files. This embodiment of the invention indirectly achieves the connection of the Node.js package by using JavaScript files instead of the Node.js package. Therefore, if the version of the Node.js package changes, only the target information needs to be re-entered on the low-code development platform, eliminating the need for redeployment and saving time and effort. Attached Figure Description

[0039] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0040] Figure 1 This is one of the flowcharts illustrating the steps of a method for accessing a Node.js package according to an embodiment of the present invention;

[0041] Figure 2 This is a schematic diagram of the application architecture of a method for accessing a Node.js package provided in an embodiment of the present invention;

[0042] Figure 3 This is a structural block diagram of a device for accessing a Node.js package, provided in an embodiment of the present invention.

[0043] Figure 4 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0044] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0045] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of the invention. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.

[0046] In various embodiments of the present invention, it should be understood that the sequence number of each process described below does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0047] This invention addresses situations where a Node.js package is first integrated into a low-code platform or is integrated again due to a version change of the Node.js package, as described in the prior art. First, some terms used in this invention will be explained:

[0048] Node.js is a JavaScript runtime environment based on the Chrome V8 engine. It uses an event-driven, non-blocking I / O model to run JavaScript on the server-side development platform.

[0049] Node.js packages: Third-party modules for Node.js, encapsulating various third-party components. Here, Node.js packages can also be called node packages or npm packages, and are managed by npm.

[0050] JavaScript (JS for short) is a lightweight, interpreted or just-in-time (JIT) programming language that prioritizes functions.

[0051] See Figure 1 This invention provides a method for accessing Node.js packages, applicable to low-code development platforms. The method may include:

[0052] Step 101: Obtain the target information of the Node.js package to be integrated.

[0053] In this step, the target information includes the source address, which is the download address of the Node.js package to be integrated. The Node.js package includes at least one component. These components can be understood as pre-packaged functional modules. During project development on the low-code development platform, if the Node.js package has already been integrated, any component within it can be directly used to meet project requirements. It is understood that the Node.js package to be integrated conforms to the relevant specifications and can be directly imported into the project as a data package. Preferably, the user can input the target information of a Node.js package into the low-code development platform's page, and then obtain this target information from the page, using it as the target information for the Node.js package to be integrated. For example, the user enters the source address of a Node.js package in the input box of the Node.js package management page on the low-code development platform, obtains the data content from the input box of the Node.js package management page, and uses the obtained source address as the target information for the Node.js package to be integrated. Of course, other methods can also be used to obtain the target information of the Node.js package to be integrated. For example, a user can upload a Node.js package information table containing the target information of the Node.js package to be integrated to a low-code development platform, and then obtain the target information of the Node.js package to be integrated by retrieving this Node.js package information table. This invention does not limit the method of obtaining the target information of the Node.js package to be integrated; any method that can obtain the target information of the Node.js package to be integrated falls within the protection scope of this invention.

[0054] Step 102: Obtain the Node.js package based on the target information.

[0055] It should be noted that, typically, the Node.js packages to be integrated are stored on a third-party platform, which can be considered an npm third-party package manager repository. This npm repository pre-stores Node.js packages that may be used during project development, for users to use during project development. Thus, when a user needs to use a specific Node.js package while developing a project on a low-code development platform, they can input the target information to obtain that Node.js package. Here, the corresponding Node.js package can be directly downloaded via its source address, and the downloaded Node.js package is identified as the one to be integrated.

[0056] Step 103: For each component in the Node.js package, generate the JavaScript file and storage path for accessing the low-code development platform.

[0057] In this step, a corresponding JavaScript file and storage path are generated for each component. This allows for multiple pairs of JavaScript files and storage paths to be generated even with multiple components. In other words, there is a one-to-one correspondence between components and JavaScript files, and between JavaScript files and storage paths. Different components have different JavaScript files, and different JavaScript files have different storage paths. Here, for each component, using its corresponding JavaScript file and storage path, the JavaScript file can be directly integrated into the low-code development platform, thereby indirectly integrating the component into the low-code development platform.

[0058] It is understandable that the storage path is the storage path of its corresponding JavaScript file, and the corresponding JavaScript file can be found by querying the storage path.

[0059] Step 104: Store the JavaScript file and its storage path in the database.

[0060] In this step, since the storage path is the storage path of the JavaScript file, the JavaScript file will be stored according to its corresponding storage path when stored in the database. Also, when there are multiple components in a Node.js package, there will be multiple storage paths. These storage paths can be stored as a list. That is, a path list is generated based on these multiple storage paths, and the path list is stored in the database, but this is not limited to this. It should be noted that steps 102 to 104 above can be implemented using Node.js services.

[0061] Step 105: With the Node.js package running, connect the JavaScript files to the low-code development platform based on the storage path in the database.

[0062] It should be noted that in actual project development, due to the high frequency of Node.js packages, developers usually integrate them even if they initially don't intend to use them, to avoid spending time integrating them later if needed. This invention divides the integration process into two stages: the first stage is obtaining the Node.js package from a third party; the second stage is integrating the obtained Node.js package into the low-code development platform. The prerequisite for the second stage is determining whether the Node.js package is running. If it is not running, there is no need to integrate the JavaScript files into the low-code development platform. Therefore, this invention can also avoid introducing the Node.js package into the low-code development platform when it is not used during project development.

[0063] In this embodiment of the invention, after receiving the target information of the Node.js package to be connected from the user's input, the target information includes the source address, thus allowing the identification of the Node.js package. Then, for each component in the Node.js package, a JavaScript file and storage path for connecting to the low-code development platform are generated. This process transforms the components in the Node.js package into JavaScript files and storage paths that can be directly connected to the low-code development platform, instead of directly connecting to the Node.js package itself. The JavaScript files and storage paths are first stored in a database, and then, while the Node.js package is running, data is read from the database to achieve the connection of the JavaScript files. This embodiment of the invention indirectly achieves the connection of the Node.js package by using JavaScript files instead of the Node.js package itself. Therefore, if the version of the Node.js package changes, only the target information needs to be re-entered on the low-code development platform, eliminating the need for redeployment and saving time and effort.

[0064] Optionally, the target information may also include: the target version number.

[0065] Based on the target information, obtain the Node.js packages, including:

[0066] Based on the source address of the Node.js package, obtain the version of the Node.js package indicated by the target version number from a third-party server.

[0067] It should be noted that the third-party server pre-stores multiple versions of Node.js packages, and these different versions have different version numbers. The target version number can be any version number. The third-party server is the npm third-party package management repository mentioned above, which will not be elaborated further here. Assume the third-party server pre-stores three different versions of Node.js packages, with version numbers 1.1.0, 1.1.1, and 1.1.2 respectively. If the project requires the latest version of the Node.js package, the user needs to enter the source address and 1.1.2 when inputting the target information, thus downloading version 1.1.2 of the Node.js package from the third-party server. Here, when the third-party server stores multiple types of Node.js packages, different types of Node.js packages have different functions, and each type of Node.js package can include multiple versions of Node.js packages. In this case, the third-party server can determine a certain type of Node.js package through the source address, and then determine a unique Node.js package based on the target version number.

[0068] Understandably, after upgrading the Node.js package on a third-party server, if you need to upgrade the Node.js package used in your low-code development platform to the latest version, you can re-enter the target information. That is, re-enter the source address of the Node.js package and the version number of the latest version.

[0069] In this embodiment of the invention, by inputting the version number of the Node.js package to be connected, a specified version of the Node.js package can be obtained. This not only enables multi-version control of Node.js packages in low-code development platform projects, but also allows for the updating of Node.js package versions in low-code development platform projects at any time.

[0070] Optionally, for each component in the Node.js package, generate JavaScript files and storage paths for integration with the low-code development platform, including:

[0071] Extract each component from a Node.js package;

[0072] For each component, the component is repackaged to generate JavaScript files and storage paths for accessing the low-code development platform based on requests.

[0073] It should be noted that while Node.js packages can be directly imported into low-code development platform projects as data packages, their components cannot be directly integrated into the project as independent components. Therefore, this invention repackages the components so that the packaged JavaScript files can be directly integrated into the low-code development platform or its projects.

[0074] Understandably, the data content before and after repackaging doesn't change significantly; the difference lies in the packaging method or strategy used. Specifically, each component in the Node.js package, to enable the Node.js package to be integrated into a low-code development platform or project as a module, will be packaged using the first packaging strategy to form a component. This application will repackage the components using a custom second packaging strategy to form JavaScript files, which will then be integrated into the low-code development platform or project via requests.

[0075] In this embodiment of the invention, by repackaging the components, a JavaScript file that can be accessed via a low-code development platform in a request manner can be generated, thereby providing a foundation for indirect access to Node.js packages.

[0076] Optionally, the low-code development platform pre-stores a configuration table, in which a path is set for each component.

[0077] The storage path generated for the component is the path corresponding to the component in the configuration table.

[0078] It should be noted that when a Node.js package contains multiple components, the JavaScript files corresponding to each component can be stored in a fixed location each time the Node.js package is integrated, meaning the storage path for each component remains constant. This way, when updating the Node.js package, only the original data at the location indicated by the storage path needs to be replaced. Since the storage path for each component remains unchanged, running the project directly will not result in errors. Ideally, different components should have different component names, and the path corresponding to each component should contain that component name, thus ensuring that the storage paths for each component are distinct.

[0079] Specifically, the configuration table can have at least two fields. The first field records the component name, and the second field records the path to the component. After retrieving the Node.js package, the corresponding path is found based on the component name within the Node.js package and used as the storage path.

[0080] In this embodiment of the invention, the JavaScript files corresponding to each component are stored in a fixed location, so that when updating the Node.js package, only the original data at the location indicated by the storage path needs to be replaced, and no errors will occur even if the project is run directly.

[0081] Optionally, when running a Node.js package, JavaScript files can be integrated into the low-code development platform based on the storage path in the database, including:

[0082] If the target page is displayed, obtain the storage path in the database; the target page is the configuration page used to set up the project on the low-code development platform.

[0083] JavaScript files are integrated into a low-code development platform based on the storage path.

[0084] It should be noted that the low-code development platform provides a target page for users to configure project setup. When a user opens this target page, the platform reads the previously stored JavaScript files and their storage paths from the database, and then integrates these JavaScript files into the low-code development platform for user use. Project configuration here can be understood as adding different components from Node.js packages to the project.

[0085] In this embodiment of the invention, JavaScript files are accessed through the target page of a low-code development platform. This allows users to utilize different components from the Node.js package when configuring their projects.

[0086] Optionally, after connecting the JavaScript file to the low-code development platform based on the storage path, the method further includes:

[0087] Display the controls corresponding to each JavaScript file on the target page.

[0088] Upon receiving input for the target control, the JavaScript file corresponding to the target control is integrated into the currently running project on the low-code development platform. The target control can be any control corresponding to any JavaScript file.

[0089] It should be noted that the target page displays a corresponding control for each JavaScript file to facilitate visual operation by the user. Understandably, a project may not use all components of the Node.js library; users can freely choose which components to integrate based on project needs. Specifically, users can long-press, drag, or double-click any control to integrate the corresponding JavaScript file into the currently running project on the low-code development platform, thus indirectly integrating the selected component into the project. Here, users can input one control at a time, integrating multiple JavaScript files into the project through multiple inputs. Alternatively, users can input multiple controls at once, integrating multiple JavaScript files into the project with a single input. For example, multiple clicks can select multiple different controls, and then dragging and dropping the corresponding JavaScript files into the project.

[0090] In this embodiment of the invention, by displaying controls corresponding to each JavaScript file on the target page, users can perform visual operations, allowing them to freely select any JavaScript file to integrate into their project according to their needs.

[0091] like Figure 2 As shown in the figure, this embodiment of the invention provides an application architecture diagram for a method of accessing Node.js packages, wherein the low-code development platform includes at least a package management page and a project configuration page.

[0092] When users are developing projects using a low-code development platform, if they need to integrate a third-party Node.js package for the first time or update an existing Node.js package, they should first perform step 201: Open the package management page, enter the source address and version number of the Node.js package, and submit.

[0093] Step 202: Use the Node service to download the corresponding version of the Node.js package from the third-party platform and generate a list of JavaScript files and their paths. The process of generating the list of JavaScript files and their paths can be found in step 103 above, and will not be repeated here.

[0094] Step 203: Store the generated list of JavaScript files and paths in the database for later use.

[0095] Step 204: After the user opens the project configuration page, the controls corresponding to each JavaScript file are displayed on the project configuration page for the user to use.

[0096] Step 205: If one or more controls are added to the currently running project, integrate the corresponding JavaScript files for those controls into the project. After updating the Node.js package version, steps 201-204 can be re-executed to update the component versions in the Node.js package.

[0097] In this embodiment of the invention, not only can multi-version control of Node.js packages be achieved in a low-code development platform project, but the versions of Node.js packages in the project can also be updated at any time. Furthermore, the low-code development platform project does not need to be redeployed during this process.

[0098] The above describes the method for accessing Node.js packages provided by the embodiments of the present invention. The following will describe the apparatus for accessing Node.js packages provided by the embodiments of the present invention with reference to the accompanying drawings.

[0099] like Figure 3 As shown, this embodiment of the invention provides a device for accessing Node.js packages, applied to a low-code development platform. The device includes:

[0100] Input module 31 is used to obtain the target information of the Node.js package to be connected, wherein the target information includes the source address and the Node.js package includes at least one component.

[0101] Module 32 is used to retrieve Node.js packages based on target information.

[0102] Module 33 is used to generate JavaScript files and storage paths for each component in the Node.js package, which are used to access the low-code development platform.

[0103] Storage module 34 is used to store JavaScript files and storage paths to the database.

[0104] Access module 35 is used to connect JavaScript files to the low-code development platform based on the storage path in the database when running Node.js packages.

[0105] Optionally, the target information may also include: the target version number.

[0106] Module 32 is specifically used to obtain the version of the Node.js package indicated by the target version number from a third-party server based on the source address of the Node.js package.

[0107] The third-party server pre-stores multiple versions of Node.js packages, and different versions of Node.js packages have different version numbers.

[0108] Optionally, the generation module 33 includes:

[0109] Extraction unit, used to extract each component in a Node.js package.

[0110] The generation unit is used to repackage each component separately, generating JavaScript files and storage paths for accessing the low-code development platform based on requests.

[0111] Optionally, the low-code development platform pre-stores a configuration table, in which a path is set for each component.

[0112] The storage path generated for the component is the path corresponding to the component in the configuration table.

[0113] Optionally, the access module 35 includes:

[0114] The retrieval unit is used to retrieve the storage path in the database when the target page is displayed; the target page is the configuration page of the low-code development platform used to set up the project.

[0115] The access unit is used to connect JavaScript files to the low-code development platform based on the storage path.

[0116] Optionally, the device further includes:

[0117] The display module is used to display the controls corresponding to each JavaScript file on the target page.

[0118] The project access module is used to access the JavaScript file corresponding to the target control into the currently running project of the low-code development platform when input is received for the target control. The target control can be any control corresponding to any JavaScript file.

[0119] In this embodiment of the invention, after receiving the target information of the Node.js package to be connected from the user's input, the target information includes the source address, thus allowing the identification of the Node.js package. Then, for each component in the Node.js package, a JavaScript file and storage path for connecting to the low-code development platform are generated. This process transforms the components in the Node.js package into JavaScript files and storage paths that can be directly connected to the low-code development platform, instead of directly connecting to the Node.js package itself. The JavaScript files and storage paths are first stored in a database, and then, while the Node.js package is running, data is read from the database to achieve the connection of the JavaScript files. This embodiment of the invention indirectly achieves the connection of the Node.js package by using JavaScript files instead of the Node.js package itself. Therefore, if the version of the Node.js package changes, only the target information needs to be re-entered on the low-code development platform, eliminating the need for redeployment and saving time and effort.

[0120] The device for accessing Node.js packages provided in this application embodiment can achieve... Figure 1 and Figure 2 The various processes implemented in the method embodiments achieve the same technical effect, and will not be described again here to avoid repetition.

[0121] On the other hand, embodiments of the present invention also provide an electronic device, including a memory, a processor, a bus, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps in the above-described method for accessing the Node.js package.

[0122] For example, see below. Figure 4 A schematic diagram of the physical structure of an electronic device is shown.

[0123] like Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430, and a communication bus 440, wherein the processor 410, the communication interface 420, and the memory 430 communicate with each other through the communication bus 440. The processor 410 can call logical instructions in the memory 430 to execute the following methods:

[0124] Obtain the target information of the Node.js package to be integrated, including the source address and the Node.js package including at least one component.

[0125] Based on the target information, obtain the Node.js package.

[0126] For each component in the Node.js package, generate JavaScript files and storage paths for integration with low-code development platforms.

[0127] Store the JavaScript file and its storage path in the database.

[0128] When running a Node.js package, JavaScript files are connected to the low-code development platform based on the storage path in the database.

[0129] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0130] Furthermore, embodiments of the present invention also provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the method for accessing the Node.js package provided in the above embodiments, for example including:

[0131] Obtain the target information of the Node.js package to be integrated, including the source address and the Node.js package including at least one component.

[0132] Based on the target information, obtain the Node.js package.

[0133] For each component in the Node.js package, generate JavaScript files and storage paths for integration with low-code development platforms.

[0134] Store the JavaScript file and its storage path in the database.

[0135] When running a Node.js package, JavaScript files are connected to the low-code development platform based on the storage path in the database.

[0136] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0137] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0138] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for integrating Node.js packages, applied to a low-code development platform, characterized in that, The method includes: Obtain the target information of the Node.js package to be connected, wherein the target information includes the source address and the Node.js package includes at least one component; Based on the target information, obtain the Node.js package; For each component in the Node.js package, generate a JavaScript file and storage path for accessing the low-code development platform; Store the JavaScript file and its storage path in the database; When the Node.js package is running, the JavaScript file is connected to the low-code development platform based on the storage path in the database.

2. The method according to claim 1, characterized in that, The target information also includes: the target version number; The step of obtaining the Node.js package based on the target information includes: Based on the source address of the Node.js package, obtain the version of the Node.js package indicated by the target version number from a third-party server; The third-party server pre-stores multiple versions of the Node.js package, and different versions of the Node.js package have different version numbers.

3. The method according to claim 1, characterized in that, For each component in the Node.js package, generate a JavaScript file and storage path for accessing the low-code development platform, including: Extract each component from the Node.js package; For each of the aforementioned components, the components are repackaged to generate JavaScript files and storage paths for accessing the low-code development platform based on requests.

4. The method according to claim 1, characterized in that, The low-code development platform pre-stores a configuration table, and the configuration table sets a path for each of the components. The storage path generated for the component is the path corresponding to the component in the configuration table.

5. The method according to claim 1, characterized in that, When running the Node.js package, connecting the JavaScript file to the low-code development platform based on the storage path in the database includes: When the target page is displayed, the storage path in the database is obtained; wherein, the target page is the page of the low-code development platform used for setting up project configuration; Based on the storage path, the JavaScript file is connected to the low-code development platform.

6. The method according to claim 5, characterized in that, After connecting the JavaScript file to the low-code development platform based on the storage path, the method further includes: The target page displays the controls corresponding to each of the JavaScript files. Upon receiving input for a target control, the JavaScript file corresponding to the target control is integrated into the currently running project of the low-code development platform, wherein the target control is a control corresponding to any of the JavaScript files.

7. A device for accessing Node.js packages, applied to a low-code development platform, characterized in that, The device includes: The input module is used to obtain the target information of the Node.js package to be accessed, wherein the target information includes the source address and the Node.js package includes at least one component; The acquisition module is used to acquire the Node.js package based on the target information; A generation module is used to generate JavaScript files and storage paths for accessing the low-code development platform for each component in the Node.js package. The storage module is used to store the JavaScript file and its storage path in the database; The access module is used to access the JavaScript file to the low-code development platform based on the storage path in the database when the Node.js package is running.

8. The apparatus according to claim 7, characterized in that, The target information also includes: the target version number; The acquisition module is specifically used to obtain the version of the Node.js package indicated by the target version number from a third-party server based on the source address of the Node.js package; The third-party server pre-stores multiple versions of the Node.js package, and different versions of the Node.js package have different version numbers.

9. An electronic device comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is executed by the processor, it implements the steps of the method for accessing a Node.js package as described in any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the steps of the method for accessing a Node.js package as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Application processing system and method for intelligent device

    CN106598872A

  • Systems and methods for just-in-time state sharing

    US20150341421A1