In this lesson we will publish our package. We will first add a prepublish script that runs our buildscript; this will ensure the built folder gets added to npm when published. We will also add a .npmignore so that only our built files get installed. We need to run npm adduser to log in to an npm account. We can then run npm publish to publish our package and view it on npm.

Note: if you want to actually publish the package from this course, you'll need to rename it since sensitive-words is already taken. You can use a scoped package name for this as well.

Inside our .npmigore:

src // ignore, therefore users install our package will not include src folder

script:

"prepublish": "npm run build",

Add prepublish script, so that everytime we publish the lib, will make sure use the latest code.

[NPM] Publish npm packages using npm publish的更多相关文章

  1. Resolving EACCES permissions errors when installing packages globally(npm 遇到 write access的问题)

    If you see an EACCES error when you try to install a package globally, you can either: Reinstall npm ...

  2. npm常用命令学习(npm install -D,semver版本规范, npm进行版本管理的最佳实践用法)

    什么是npm npm有两层含义.一层含义是Node的开放式模块登记和管理系统,网址为npmjs.org.另一层含义是Node默认的模块管理器,是一个命令行下的软件,用来安装和管理Node模块. npm ...

  3. 如何开发一个npm包并发布到npm中央仓库

    转自: https://liaolongdong.com/2019/01/24/publish-public-npm.html 如何开发一个npm包并发布到npm中央仓库需求背景:平时在项目工作中可能 ...

  4. npm包的上传npm包的步骤,与更新和下载步骤

    官网: ======================================================= 没有账号可以先注册一个,右上角点击“Sign Up",有账号直接点击“ ...

  5. npm太慢, 修改npm镜像

    今天晚上想要将clone下来的项目进行npm install,但是等了半天都没动 查看源 npm config get registry 或 npm config list https://regis ...

  6. nodejs+express工程 在npm install之后或使用npm install bootstrap命令安装bootstrap之后

    nodejs+express工程 在npm install之后或使用npm install bootstrap命令安装bootstrap之后引入bootstrap文件 如果你的静态资源存放在多个目录下 ...

  7. vue-create 报错 command failed: yarn --registry=https://registry.npm.taobao.org --disturl=https://npm.taobao.org/dist 完美解决方案

    @vue/cli 3.x 创建项目失败解决方案 报错信息 command failed: yarn --registry=https://registry.npm.taobao.org --distu ...

  8. npm i xxxx -D和npm i xxxx-S的区别

    npm i xxxx -D 就是 npm i xxxx --save-dev 是把依赖写入进devDependencies对象里面 devDependencies 是开发环境下的依赖,这里是开发环境下 ...

  9. 如何使用npm的部分用法以及npm被墙的解决方法

    我们要明白我们使用的npm就是node中自带的包(模块)管理工具:借助NPM可以帮助我们快速安和管理依赖包,使Node与第三方模块之间形成了一个良好的生态系统. 我们可以直接输入npm,查看帮助引导: ...

  10. npm i node-sass 报错&npm 镜像切换

    npm install --save node-sass --registry=https://registry.npm.taobao.org --disturl=https://npm.taobao ...

随机推荐

  1. jFinal 关联数据库操作

    1.建数据库(我用的是oracle数据库,其他的相对也差不多) -- Create table create table CLASSES ( classesid NUMBER not null, cl ...

  2. Codeforces 344C Rational Resistance

    Description Mad scientist Mike is building a time machine in his spare time. To finish the work, he ...

  3. 携手互联网企业10巨头设VC基金

    包括小米科技.盛大集团.人人网.掌趣科技.游族网络.龙图游戏.蓝港互动.37游戏.星辉互动娱乐.博雅互动等10家知名互联网企业作为出资人(LP)的优格创投基金近日正式成立. 众所周知,伴随着移动互联网 ...

  4. css3 文字溢出 换行实现方案

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  5. C# Dapper 基本使用 增删改查事务等

    using DapperTest.Models; using System.Collections.Generic; using System.Web.Http; using Dapper; usin ...

  6. 应用层协议——HTTP

    HTTP: Client HTTP <--> 应用程序HTTP报文 <--> Server HTTP 应用程序 由TCP支持 Statelessprotocol:不会记录客户端 ...

  7. BZOJ 刷题记录 PART 5

    拖了好久才写的. [BZOJ2821]接触分块大法.这道题略有点新颖.首先我们先分块.然后统计每块中每一个数出现的个数. 以下是联立各个方块,预处理出第I个方块到第J个方块出现正偶数次数的个数. fo ...

  8. SQL Server 为代码减负之存储过程

        存储过程能够用来提高数据库的查询效率.由于它事先被编译过.被储存于内存中,每次执行前.不必被从新编译,所以效率非常高. 存储过程是一组sql增删改查的集合,假设程序中的一个功能涉及到对数据库的 ...

  9. Excel显示当前日期

    https://zhidao.baidu.com/question/431460329693825764.html 直接选中单元格,在公示栏输入=now()

  10. 如何实现对网站页面访问量的统计(javaweb和php)

    如何实现对网站页面访问量的统计(javaweb和php) 一.总结 一句话总结:其实很简单啦,每访问一次那个页面对应的index函数(控制器中的那个函数)访问次数就加1就可以了. 1.javaweb中 ...