diff --git a/.github/ISSUE_TEMPLATE/issue_template.md b/.github/ISSUE_TEMPLATE/issue_template.md new file mode 100644 index 0000000..f807f86 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/issue_template.md @@ -0,0 +1,28 @@ +--- +name: Tracking issue +about: New features. +title: "[DATE]: [FEATURE NAME]" +labels: tracking issue, needs triage +assignees: mikbry +--- + +### Description +A clear and concise description of what the issue is about. + +### Expected behaviour +If a bug, what do you expect ? + +### Actual behaviour +If a bug, what is the current result. + +### Steps to reproduce +If a bug, how do you reproduce it : +- step 1 +- step 2 +- step x +- the bug + +### Environnement +Node version +Npm / Yarn +OS diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..de3add8 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,17 @@ +### Fix issues + +- [ ] #issuenumber + +### Description + +{Please describe here the changes} + +### Check List + +- [ ] respect code conventions and usages +- [ ] tests and 100% coverage +- [ ] well documented +- [ ] self review + +### Review targets: +- nodejs / npm / yarn \ No newline at end of file diff --git a/LICENSE b/LICENSE index 49bfe48..ca1f425 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 Mik +Copyright (c) 2019 Mik BRY Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 340f354..9b871ac 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,19 @@ -# anzip [![Build Status](https://travis-ci.com/mikbry/anzip.svg?token=mRB1zwsyoRAKcamR2qpU)](https://travis-ci.com/mikbry/anzip) [![codecov](https://codecov.io/gh/mikbry/anzip/branch/master/graph/badge.svg?token=K4P0vnM5fh)](https://codecov.io/gh/mikbry/anzip) +# Anzip + +[![Build Status][travis-image]][travis-url] +[![codecov][codecov-image]][codecov-url] +[![NPM version][npm-image]][npm-url] +[![License][license-image]][license-url] + +[travis-image]: https://travis-ci.com/mikbry/anzip.svg?token=mRB1zwsyoRAKcamR2qpU +[travis-url]: https://travis-ci.com/mikbry/anzip +[codecov-image]: https://codecov.io/gh/mikbry/anzip/branch/master/graph/badge.svg?token=K4P0vnM5fh +[codecov-url]: https://codecov.io/gh/mikbry/anzip +[npm-image]: https://img.shields.io/npm/v/anzip.svg +[npm-url]: https://npmjs.org/package/anzip +[license-image]: https://img.shields.io/npm/l/anzip.svg +[License-url]:./LICENSE + > Anzip is a library to unzip file archive for Node using only one async function. @@ -17,12 +32,12 @@ ___ --- ### Install -``` +```bash yarn add anzip ```` Or using npm -``` +```bash npm add anzip ```` @@ -31,28 +46,29 @@ npm add anzip ### Usage > Now that ESM support is widely common, `require` should be forgotten. -``` +```javascript import anzip from 'anzip'; ``` > Extract file.zip to current path -``` +```javascript await anzip('file.zip'); ``` > Extract file.zip to the current path and get output -``` +```javascript const output = await anzip('file.zip'); console.log('duration=', output.duration); console.log('number of files=', output.files.length); ``` > Extract only README.md from file.zip to current path -``` + +```javascript const output = await anzip('file.zip', { pattern: 'README.md', }); console.log('duration=', output.duration); console.log('number of files=', output.files.length); // Should be one @@ -60,14 +76,15 @@ console.log('number of files=', output.files.length); // Should be one > Extract only README.md from file.zip to output content variable -``` +```javascript const output = await anzip('file.zip', { pattern: 'README.md', outputContent: true }); console.log('duration=', output.duration); console.log('content=', output.files[0].content); ``` > Extract only README.md from file.zip to output content variable and currentpath -``` + +```javascript const output = await anzip('file.zip', { pattern: 'README.md', outputPath: './', outputContent: true }); console.log('duration=', output.duration); console.log('content=', output.files[0].content); @@ -75,7 +92,7 @@ console.log('content=', output.files[0].content); > Extract with an entryHandler to fliter entry -``` +```javascript const outputPath = './path'; const entryHandler = async entry => { let resp = true; @@ -99,7 +116,7 @@ console.log('duration=', output.duration); > Extract using 2 rules and an entryHandler in one to fliter entry -``` +```javascript const outputPath = './path'; const entryHandler = async entry => { let resp = true; @@ -166,4 +183,7 @@ console.log('duration=', output.duration); | files[x].content | Buffer | the content of the file available if opts.outputContent=true or rule.outputContent=true | | files[x].error | Error | if an error occured | ---- \ No newline at end of file +--- +## Contribution + +Read [Contributing Guide](CONTRIBUTING.md) for development setup instructions. \ No newline at end of file