Skip to content

Commit

Permalink
fix: use export default instead of module exports
Browse files Browse the repository at this point in the history
chore(deps): bump npm packages
chore: add husky, commitlint, standard version
docs: update usage for new export default syntax
  • Loading branch information
maitrungduc1410 committed Jul 8, 2021
1 parent 2f9a066 commit 0bfbc8c
Show file tree
Hide file tree
Showing 8 changed files with 2,263 additions and 81 deletions.
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit "$1"
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ src
.git*
tsconfig.json
tslint.json
test.js
test.js
.github
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Changelog

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

# [0.0.7](#) (2020-09-18)
### Features
- Add authentication using `privateKey`
Expand Down
144 changes: 108 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ yarn add node-scp
## Scp file from local to remote server
Using `Promise`
```js
const scp = require('node-scp')
// with commonJS
const { Client } = require('node-scp')

scp({
// with ES Module
import { Client } from 'node-scp'

Client({
host: 'your host',
port: 22,
username: 'username',
Expand All @@ -52,11 +56,15 @@ scp({

Using `async/await`:
```js
const scp = require('node-scp')
// with commonJS
const { Client } = require('node-scp')

// with ES Module
import { Client } from 'node-scp'

async function test() {
try {
const client = await scp({
const client = await Client({
host: 'your host',
port: 22,
username: 'username',
Expand All @@ -79,9 +87,13 @@ test()
## Scp file from remote server to local
Using `Promise`
```js
const scp = require('node-scp')
// with commonJS
const { Client } = require('node-scp')

// with ES Module
import { Client } from 'node-scp'

scp({
Client({
host: 'your host',
port: 22,
username: 'username',
Expand All @@ -99,11 +111,15 @@ scp({

Using `async/await`:
```js
const scp = require('node-scp')
// with commonJS
const { Client } = require('node-scp')

// with ES Module
import { Client } from 'node-scp'

async function test () {
try {
const client = await scp({
const client = await Client({
host: 'your host',
port: 22,
username: 'username',
Expand All @@ -124,9 +140,13 @@ test()
## Scp a directory from local to remote server
Using `Promise`
```js
const scp = require('node-scp')
// with commonJS
const { Client } = require('node-scp')

// with ES Module
import { Client } from 'node-scp'

scp({
Client({
host: 'your host',
port: 22,
username: 'username',
Expand All @@ -144,11 +164,15 @@ scp({

Using `async/await`:
```js
const scp = require('node-scp')
// with commonJS
const { Client } = require('node-scp')

// with ES Module
import { Client } from 'node-scp'

async funtion test () {
try {
const client = await scp({
const client = await Client({
host: 'your host',
port: 22,
username: 'username',
Expand All @@ -169,9 +193,13 @@ test()
## Scp a directory from remote server to local
Using `Promise`
```js
const scp = require('node-scp')
// with commonJS
const { Client } = require('node-scp')

// with ES Module
import { Client } from 'node-scp'

scp({
Client({
host: 'your host',
port: 22,
username: 'username',
Expand All @@ -189,11 +217,15 @@ scp({

Using `async/await`:
```js
const scp = require('node-scp')
// with commonJS
const { Client } = require('node-scp')

// with ES Module
import { Client } from 'node-scp'

async funtion test () {
try {
const client = await scp({
const client = await Client({
host: 'your host',
port: 22,
username: 'username',
Expand All @@ -214,9 +246,13 @@ test()
## Create a directory on remote server
Using `Promise`
```js
const scp = require('node-scp')
// with commonJS
const { Client } = require('node-scp')

// with ES Module
import { Client } from 'node-scp'

scp({
Client({
host: 'your host',
port: 22,
username: 'username',
Expand All @@ -234,11 +270,15 @@ scp({

Using `async/await`:
```js
const scp = require('node-scp')
// with commonJS
const { Client } = require('node-scp')

// with ES Module
import { Client } from 'node-scp'

async function test() {
try {
const client = await scp({
const client = await Client({
host: 'your host',
port: 22,
username: 'username',
Expand All @@ -259,9 +299,13 @@ test()
## Check if a path exists on remote server
Using `Promise`
```js
const scp = require('node-scp')
// with commonJS
const { Client } = require('node-scp')

// with ES Module
import { Client } from 'node-scp'

scp({
Client({
host: 'your host',
port: 22,
username: 'username',
Expand All @@ -280,10 +324,14 @@ scp({

Using `async/await`:
```js
const scp = require('node-scp')
// with commonJS
const { Client } = require('node-scp')

// with ES Module
import { Client } from 'node-scp'
async function test() {
try {
const client = await scp({
const client = await Client({
host: 'your host',
port: 22,
username: 'username',
Expand All @@ -305,9 +353,13 @@ test()
## Get stats of a path on remote server
Using `Promise`
```js
const scp = require('node-scp')
// with commonJS
const { Client } = require('node-scp')

scp({
// with ES Module
import { Client } from 'node-scp'

Client({
host: 'your host',
port: 22,
username: 'username',
Expand All @@ -326,11 +378,15 @@ scp({

Using `async/await`:
```js
const scp = require('node-scp')
// with commonJS
const { Client } = require('node-scp')

// with ES Module
import { Client } from 'node-scp'

async function test() {
try {
const client = await scp({
const client = await Client({
host: 'your host',
port: 22,
username: 'username',
Expand All @@ -352,9 +408,13 @@ test()
## List all files in remote directory
Using `Promise`
```js
const scp = require('node-scp')
// with commonJS
const { Client } = require('node-scp')

scp({
// with ES Module
import { Client } from 'node-scp'

Client({
host: 'your host',
port: 22,
username: 'username',
Expand All @@ -373,11 +433,15 @@ scp({

Using `async/await`:
```js
const scp = require('node-scp')
// with commonJS
const { Client } = require('node-scp')

// with ES Module
import { Client } from 'node-scp'

async function test() {
try {
const client = await scp({
const client = await Client({
host: 'your host',
port: 22,
username: 'username',
Expand All @@ -399,9 +463,13 @@ test()
## Convert relative path to absolute path on remote server
Using `Promise`
```js
const scp = require('node-scp')
// with commonJS
const { Client } = require('node-scp')

scp({
// with ES Module
import { Client } from 'node-scp'

Client({
host: 'your host',
port: 22,
username: 'username',
Expand All @@ -420,11 +488,15 @@ scp({

Using `async/await`:
```js
const scp = require('node-scp')
// with commonJS
const { Client } = require('node-scp')

// with ES Module
import { Client } from 'node-scp'

async function test() {
try {
const client = await scp({
const client = await Client({
host: 'your host',
port: 22,
username: 'username',
Expand Down
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {extends: ['@commitlint/config-conventional']}

0 comments on commit 0bfbc8c

Please sign in to comment.