🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

file-static-server-start

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

file-static-server-start

> 简易静态资源服务器,运行后在当前目录启动监听。

latest
npmnpm
Version
1.0.8
Version published
Maintainers
1
Created
Source

file-static-server-start

简易静态资源服务器,运行后在当前目录启动监听。

功能

  • 当前目录监听
  • 全局安装后可以直接全局执行
  • 输出当前文件夹下文件链接

演示

安装

yarn global add file-static-server-start

使用

fss

即在当前目录启动监听,浏览器打开http://127.0.0.1:5544/[xxx]即可下载文件,其中xxx是当前文件夹下的文件名。

构建流程

配置

对于一个普通的node项目,使其可执行需要如下配置:

添加执行头到index.js/ts

#!/usr/bin/env node

package的配置

  "bin": {
    "fss": "dist/index.js"
  },

会安装以一个fss的命令

打包

tsc

发布

npm login

注:重名的包发布会报403错误

升级

修改后升级再发布:

npm version patch
npm publish

全局安装

yarn global add my-xxx

使用

运行bin字段对应的命令即可。

Reference

FAQs

Package last updated on 26 Oct 2021

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