So it can be proved. You can now run this command anywhere on your computer, using your own NPX is cool. The
Now we have the basic model of tool development. Use and debug NPX packages in context and develop locally. The last part is very important. I am making development tools. If you use the tool you are developing to check whether it works, you can use this function immediately after working. Yes, I also want to push the changes to remote version control and enable the package through NPM. But when developing, I don’t want to consider distribution management. Using the Command commander, the developer created two commands in the automation node by outputting the Command commander of \
To achieve this, the following four points are required: The ability to local files from a remote URL. Function, use the first function, and then change the namespace of the result file. The function that calls this function will be a valid argument. The command that calls the function. Let’s look at the list. I don’t want to write a complete tutorial on node file systems, but here’s a concentrated lesson. Male node uses \
Fs Existssync (\u dirname +’\/hiroy.txt’); The
The FS module is fairly easy to read. This feature is called \
The following modules handle ing files via HTTPS using the HTTPS module and writing files using the FS module. Last indented module. Exports= please follow the . The is a reference to a function, so you can use the function when you need the file. This is the method used in the next module. The following are the modules for ing files and changing the PHP namespace: Const = required (\
Const replace =require (\
Const path = requirement (\
\/**The
* files and change namespaces
*The
*The
*@Param{string} remote file to copy
*@Write path to param{string}destpath file
*@Param{string}namespace namespace for new files
*\/The
function phpandnamespace (file, target path, namespace){
(file, destination path, () = >{
replace
Source: \
To: namespace,
File: [destination path]
});
});
}The
Module Exports= phpandnamespace; If you are still familiar with required (), you need to it