<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://note.simperator.com/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://note.simperator.com/feed.php">
        <title>天涯的知库 - it:node</title>
        <description>聚沙成塔</description>
        <link>https://note.simperator.com/</link>
        <image rdf:resource="https://note.simperator.com/lib/exe/fetch.php?media=wiki:dokuwiki.svg" />
       <dc:date>2026-05-06T12:53:16+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://note.simperator.com/doku.php?id=it:node:localhost_ssl&amp;rev=1682267153&amp;do=diff"/>
                <rdf:li rdf:resource="https://note.simperator.com/doku.php?id=it:node:npmpackage&amp;rev=1769072725&amp;do=diff"/>
                <rdf:li rdf:resource="https://note.simperator.com/doku.php?id=it:node:start&amp;rev=1627286703&amp;do=diff"/>
                <rdf:li rdf:resource="https://note.simperator.com/doku.php?id=it:node:%E5%91%BD%E4%BB%A4%E8%A1%8C&amp;rev=1691425177&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://note.simperator.com/lib/exe/fetch.php?media=wiki:dokuwiki.svg">
        <title>天涯的知库</title>
        <link>https://note.simperator.com/</link>
        <url>https://note.simperator.com/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
    </image>
    <item rdf:about="https://note.simperator.com/doku.php?id=it:node:localhost_ssl&amp;rev=1682267153&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-04-23T16:25:53+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>SSL for Localhost</title>
        <link>https://note.simperator.com/doku.php?id=it:node:localhost_ssl&amp;rev=1682267153&amp;do=diff</link>
        <description>SSL for Localhost

Yes, you can apply a SSL/TLS certificate for localhost. You can generate a self-signed certificate for localhost using the openssl command-line tool. Here's how:

Install OpenSSL on your machine if it's not already installed.

Open a terminal or command prompt and navigate to the directory where you want to store the certificate files.&lt;span class=&quot;wss-nowiki-section&quot;&gt;openssl genrsa -out localhost.key 2048&lt;/span&gt;&lt;span class=&quot;wss-nowiki-section&quot;&gt;openssl req -new -key localhost.k…</description>
    </item>
    <item rdf:about="https://note.simperator.com/doku.php?id=it:node:npmpackage&amp;rev=1769072725&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-01-22T09:05:25+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>NPM 包开发</title>
        <link>https://note.simperator.com/doku.php?id=it:node:npmpackage&amp;rev=1769072725&amp;do=diff</link>
        <description>NPM 包开发

已经做好了一模版，直接拉取就好了 

&lt;span class=&quot;wss-nowiki-section&quot;&gt;scp -r git@serverpi:~/swap/npmTemplate .&lt;/span&gt;

&lt;span class=&quot;wss-nowiki-section&quot;&gt;scp -r git@serverpi:~/swap/npmTemplate/ ./folder&lt;/span&gt;

使用 TypeScript 编写 npm 包并进行发布

一步步构建发布一个 TypeScript NPM 包

初始化

建立一个目录 base





“”&gt;&gt;


修改package.json文件

新建 tsconfig.json

创建 src 文件夹，在其下新建一个 index.ts，内容如下
export const Greeter = (name: string) =&gt; `Hello ${name}`;&lt;span class=&quot;wss-nowiki-section&quot;&gt;&amp;quot;build&amp;quot;: &amp;quot;tsc&amp;quot;&lt;/span&gt;&lt;span class=&quot;w…</description>
    </item>
    <item rdf:about="https://note.simperator.com/doku.php?id=it:node:start&amp;rev=1627286703&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-07-26T08:05:03+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title></title>
        <link>https://note.simperator.com/doku.php?id=it:node:start&amp;rev=1627286703&amp;do=diff</link>
        <description>node index</description>
    </item>
    <item rdf:about="https://note.simperator.com/doku.php?id=it:node:%E5%91%BD%E4%BB%A4%E8%A1%8C&amp;rev=1691425177&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-08-07T16:19:37+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>命令行</title>
        <link>https://note.simperator.com/doku.php?id=it:node:%E5%91%BD%E4%BB%A4%E8%A1%8C&amp;rev=1691425177&amp;do=diff</link>
        <description>命令行

建立程序

准备：在服务器上安装 node.js 以及 npm

首先初始化一個項目Node.js-CLI开发工具 &lt;span class=&quot;wss-nowiki-section&quot;&gt;npm init&lt;/span&gt;，在 package.json 中設定工具名稱

在本目錄下全局安裝 &lt;span class=&quot;wss-nowiki-section&quot;&gt;npm install -g&lt;/span&gt; 後即可使用 &lt;span class=&quot;wss-nowiki-section&quot;&gt;golden xxx&lt;/span&gt; 命令。 (因为在package.json中已经定义了bin的执行路径)&lt;span class=&quot;wss-nowiki-section&quot;&gt;npm install commander&lt;/span&gt;&lt;span class=&quot;wss-nowiki-section&quot;&gt;npm install readline&lt;/span&gt;&lt;span class=&quot;wss-nowiki-section&quot;&gt;⌃[[A&lt;/span&gt;&lt;span class=&quot;wss-nowiki-section&quot;&gt;process.s…</description>
    </item>
</rdf:RDF>
