Skip to content

Commit 759b065

Browse files
committed
feat(*): add npm plugin files
1 parent e70ef8a commit 759b065

File tree

4 files changed

+374
-2
lines changed

4 files changed

+374
-2
lines changed

.gitignore

Lines changed: 280 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,280 @@
1+
2+
# Created by https://www.gitignore.io/api/node,java,linux,macos,maven,windows,eclipse,visualstudiocode
3+
# Edit at https://www.gitignore.io/?templates=node,java,linux,macos,maven,windows,eclipse,visualstudiocode
4+
5+
### Eclipse ###
6+
.metadata
7+
bin/
8+
tmp/
9+
*.tmp
10+
*.bak
11+
*.swp
12+
*~.nib
13+
local.properties
14+
.settings/
15+
.loadpath
16+
.recommenders
17+
18+
# External tool builders
19+
.externalToolBuilders/
20+
21+
# Locally stored "Eclipse launch configurations"
22+
*.launch
23+
24+
# PyDev specific (Python IDE for Eclipse)
25+
*.pydevproject
26+
27+
# CDT-specific (C/C++ Development Tooling)
28+
.cproject
29+
30+
# CDT- autotools
31+
.autotools
32+
33+
# Java annotation processor (APT)
34+
.factorypath
35+
36+
# PDT-specific (PHP Development Tools)
37+
.buildpath
38+
39+
# sbteclipse plugin
40+
.target
41+
42+
# Tern plugin
43+
.tern-project
44+
45+
# TeXlipse plugin
46+
.texlipse
47+
48+
# STS (Spring Tool Suite)
49+
.springBeans
50+
51+
# Code Recommenders
52+
.recommenders/
53+
54+
# Annotation Processing
55+
.apt_generated/
56+
57+
# Scala IDE specific (Scala & Java development for Eclipse)
58+
.cache-main
59+
.scala_dependencies
60+
.worksheet
61+
62+
### Eclipse Patch ###
63+
# Eclipse Core
64+
.project
65+
66+
# JDT-specific (Eclipse Java Development Tools)
67+
.classpath
68+
69+
# Annotation Processing
70+
.apt_generated
71+
72+
.sts4-cache/
73+
74+
### Java ###
75+
# Compiled class file
76+
*.class
77+
78+
# Log file
79+
*.log
80+
81+
# BlueJ files
82+
*.ctxt
83+
84+
# Mobile Tools for Java (J2ME)
85+
.mtj.tmp/
86+
87+
# Package Files #
88+
*.jar
89+
*.war
90+
*.nar
91+
*.ear
92+
*.zip
93+
*.tar.gz
94+
*.rar
95+
96+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
97+
hs_err_pid*
98+
99+
### Linux ###
100+
*~
101+
102+
# temporary files which can be created if a process still has a handle open of a deleted file
103+
.fuse_hidden*
104+
105+
# KDE directory preferences
106+
.directory
107+
108+
# Linux trash folder which might appear on any partition or disk
109+
.Trash-*
110+
111+
# .nfs files are created when an open file is removed but is still being accessed
112+
.nfs*
113+
114+
### macOS ###
115+
# General
116+
.DS_Store
117+
.AppleDouble
118+
.LSOverride
119+
120+
# Icon must end with two \r
121+
Icon
122+
123+
# Thumbnails
124+
._*
125+
126+
# Files that might appear in the root of a volume
127+
.DocumentRevisions-V100
128+
.fseventsd
129+
.Spotlight-V100
130+
.TemporaryItems
131+
.Trashes
132+
.VolumeIcon.icns
133+
.com.apple.timemachine.donotpresent
134+
135+
# Directories potentially created on remote AFP share
136+
.AppleDB
137+
.AppleDesktop
138+
Network Trash Folder
139+
Temporary Items
140+
.apdisk
141+
142+
### Maven ###
143+
target/
144+
pom.xml.tag
145+
pom.xml.releaseBackup
146+
pom.xml.versionsBackup
147+
pom.xml.next
148+
release.properties
149+
dependency-reduced-pom.xml
150+
buildNumber.properties
151+
.mvn/timing.properties
152+
.mvn/wrapper/maven-wrapper.jar
153+
154+
### Node ###
155+
# Logs
156+
logs
157+
npm-debug.log*
158+
yarn-debug.log*
159+
yarn-error.log*
160+
lerna-debug.log*
161+
162+
# Diagnostic reports (https://nodejs.org/api/report.html)
163+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
164+
165+
# Runtime data
166+
pids
167+
*.pid
168+
*.seed
169+
*.pid.lock
170+
171+
# Directory for instrumented libs generated by jscoverage/JSCover
172+
lib-cov
173+
174+
# Coverage directory used by tools like istanbul
175+
coverage
176+
*.lcov
177+
178+
# nyc test coverage
179+
.nyc_output
180+
181+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
182+
.grunt
183+
184+
# Bower dependency directory (https://bower.io/)
185+
bower_components
186+
187+
# node-waf configuration
188+
.lock-wscript
189+
190+
# Compiled binary addons (https://nodejs.org/api/addons.html)
191+
build/Release
192+
193+
# Dependency directories
194+
node_modules/
195+
jspm_packages/
196+
197+
# TypeScript v1 declaration files
198+
typings/
199+
200+
# TypeScript cache
201+
*.tsbuildinfo
202+
203+
# Optional npm cache directory
204+
.npm
205+
206+
# Optional eslint cache
207+
.eslintcache
208+
209+
# Optional REPL history
210+
.node_repl_history
211+
212+
# Output of 'npm pack'
213+
*.tgz
214+
215+
# Yarn Integrity file
216+
.yarn-integrity
217+
218+
# dotenv environment variables file
219+
.env
220+
.env.test
221+
222+
# parcel-bundler cache (https://parceljs.org/)
223+
.cache
224+
225+
# next.js build output
226+
.next
227+
228+
# nuxt.js build output
229+
.nuxt
230+
231+
# vuepress build output
232+
.vuepress/dist
233+
234+
# Serverless directories
235+
.serverless/
236+
237+
# FuseBox cache
238+
.fusebox/
239+
240+
# DynamoDB Local files
241+
.dynamodb/
242+
243+
### VisualStudioCode ###
244+
.vscode/*
245+
!.vscode/settings.json
246+
!.vscode/tasks.json
247+
!.vscode/launch.json
248+
!.vscode/extensions.json
249+
250+
### VisualStudioCode Patch ###
251+
# Ignore all local history of files
252+
.history
253+
254+
### Windows ###
255+
# Windows thumbnail cache files
256+
Thumbs.db
257+
Thumbs.db:encryptable
258+
ehthumbs.db
259+
ehthumbs_vista.db
260+
261+
# Dump file
262+
*.stackdump
263+
264+
# Folder config file
265+
[Dd]esktop.ini
266+
267+
# Recycle Bin used on file shares
268+
$RECYCLE.BIN/
269+
270+
# Windows Installer files
271+
*.cab
272+
*.msi
273+
*.msix
274+
*.msm
275+
*.msp
276+
277+
# Windows shortcuts
278+
*.lnk
279+
280+
# End of https://www.gitignore.io/api/node,java,linux,macos,maven,windows,eclipse,visualstudiocode
File renamed without changes.

README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,29 @@
1-
# zsh-npm-plugin
2-
A ZSH plugin to set custom NPM aliases. Is based (forked) from Oh-My-ZSH one.
1+
# ZSH NPM Plugin
2+
3+
[![v1.0.0](https://img.shields.io/badge/version-1.1.0-brightgreen.svg)](https://github.com/trystan2k/zsh-npm-plugin/tree/v1.0.0)
4+
5+
A zsh plugin that add NPM custom alias
6+
7+
This is completely based on [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/npm) NPM plugin.
8+
9+
## Installation
10+
11+
### Using [zinit](https://github.com/zdharma/zinit)
12+
13+
Add `zinit light trystan2k/zsh-npm-plugin` into `.zshrc`
14+
15+
### Using [zpm](https://github.com/zpm-zsh/zpm)
16+
17+
Add `zpm load trystan2k/zsh-npm-plugin` into `.zshrc`
18+
19+
### Using [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh)
20+
21+
Execute `git clone https://github.com/trystan2k/zsh-npm-plugin ~/.oh-my-zsh/custom/plugins/zsh-npm-plugin`. Add `zsh-npm-plugin` into plugins array in `.zshrc`
22+
23+
### Using [antigen](https://github.com/zsh-users/antigen)
24+
25+
Add `antigen bundle trystan2k/zsh-npm-plugin` into `.zshrc`
26+
27+
### Using [zgen](https://github.com/tarjoilija/zgen)
28+
29+
Add `zgen load trystan2k/zsh-npm-plugin` into `.zshrc`

npm.plugin.sh

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Install dependencies globally
2+
alias npmg="npm i -g "
3+
4+
# Install package / dependencies
5+
alias npmi="npm i"
6+
7+
# npm package names are lowercase
8+
# Thus, we've used camelCase for the following aliases:
9+
10+
# Install and save to dependencies in your package.json
11+
# npms is used by https://www.npmjs.com/package/npms
12+
alias npmS="npm i -S "
13+
14+
# Install and save to dev-dependencies in your package.json
15+
# npmd is used by https://github.com/dominictarr/npmd
16+
alias npmD="npm i -D "
17+
18+
# Execute command from node_modules folder based on current directory
19+
# i.e npmE gulp
20+
alias npmE='PATH="$(npm bin)":"$PATH"'
21+
22+
# Check which npm modules are outdated
23+
alias npmO="npm outdated"
24+
25+
# Check package versions
26+
alias npmV="npm -v"
27+
28+
# List packages
29+
alias npmL="npm list"
30+
31+
# List top-level installed packages
32+
alias npmL0="npm ls --depth=0"
33+
34+
# List packages globally
35+
alias npmlsg="npm list -g"
36+
37+
# List top-level installed packages globally
38+
alias npmlsg0="npm list -g --depth=0"
39+
40+
# Run npm start
41+
alias npmst="npm start"
42+
43+
# Run npm test
44+
alias npmt="npm test"
45+
46+
# Run npm scripts
47+
alias npmR="npm run"
48+
49+
# Run npm publish
50+
alias npmP="npm publish"
51+
52+
# Run npm init
53+
alias npmNew="npm init"
54+
55+
# Clear node_modules in current directory
56+
# ! for prevent accidental run
57+
alias npmclr!="rm -rf ./node_modules/"
58+
59+
# Reinstall package
60+
# ! for prevent accidental run
61+
alias nre!="npmclr! && npmi"
62+
63+
# Search in the npm database
64+
alias npmF="npm search"
65+

0 commit comments

Comments
 (0)