Vue3 encapsulates custom instructions and hooks, and publishes npm packages

Requirements: Encapsulate a function that requires monitoring the width and height changes of the DOM, and supports both custom instructions and hooks. Step 1: Create the project folder v-resize-xm 1. Create the src folder in the v-resize-xm folder Execute the pnpm init command to generate a package.json file 2. Install ts sudo npm install -g […]

Figure out nvm, npm, nrm at once

Foreword: After learning nodejs, I installed nvm, npm, and nrm. When I first came into contact with it, I felt dizzy. After struggling all afternoon, I finally figured out these three big brothers. Let me take you through what these are, what they do, common commands and the errors I encountered. For me, it is […]

Vue3 + Vite package and release to npm process

Article directory 1. Preparation work 2. Initialization project 2.1 Initialization: 2.2 Create typescript configuration 2.3 Install Vue3 and Vite 2.4 Directory structure 3. Write code 3.1 Logical file code 3.2 Declaration file code 4. Configure Vite 5. Configuration commands 5.1 Write packaging commands 5.2 Packaging components 6. Release 6.1 Register an account (first time use) […]

npm module installation mechanism

Table of Contents 1. npm module installation mechanism 2.npm implementation principle 1. Execute the preinstall of the project itself 2. Determine the first-level dependent modules 3. Get the module 4. Module flattening 5. Install the module 6. Execute the life cycle of the project itself 7. Generate or update the version description file, and the […]

Vite+Vue3+TS packages an npm component and supports the IDE’s code prompt function

1. Development components 1.1 Create a new project Create a new project using vite npm create vite@latest Select Vue and Typescript Need to install the following packages: [email protected] Ok to proceed? (y) √ Project name: … vite-vue3-ts-test-fjc √ Select a framework: ? Vue √ Select a variant: ? TypeScript Scaffolding project in D:\coding\study\vite-vue3-ts-test-fjc… Done. Now […]

React components are packaged and released to npm (create-react-app+ts+cesium)

React components are packaged and released to npm (create-react-app + ts + cesium) and continuously updated~ Build react framework Scaffolding generates react framework Expose configuration file Configure alias Run the project Reconstruction project svg error cesium related configuration codemirror configuration Reference content outside the src file in react Pack Package entry and exit configuration Package […]

Node module export introduces two methods and npm package management

Benefits of modularity In Node.js, each file is treated as an independent module. The variables and functions defined in the module have independent scopes, because Node.js will use the function wrapper as shown below when executing the module code. encapsulate it (function(exports,require,module,__filename,_dirname){<!– –> //Module code actually exists here }); Moreover, the project is composed of […]

How to implement a create-vite-like scaffolding and publish it to npm

Foreword Recently I was working on an electron ecology-related project. Since I had to do some project initialization functions, I wrote a scaffolding to do this. Then I learned about and practiced the scaffolding-related functions in detail, and finally succeeded in making it. I think If you need the scaffolding, share your relevant experiences here. […]

Using npm package to implement JS code obfuscation and encryption in NodeJS

Use npm package to implement JS code obfuscation and encryption in NodeJS In the front-end and back-end JS development process, JS code protection (JS code obfuscation and encryption) is a very important part. JShaman is a cloud-based code protection SaaS platform that can obfuscate, encrypt, compress, and other operations on JS code to enhance the […]