Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,22 @@ Usage Guide

The easiest way to interface with it is by using pakmanager. Include the package from pakmanager in your html, and then in you javascript:

var Tar = require('tar'),
tape = new Tar();
```javascript
const Tar = require('tar');
const tape = new Tar();
```

Or require script from unpkg.com cdn inside of your html page:

```html
<script src="https://unpkg.com/tar-js@0.2.1/dist/tar.min.js"></script>
```

and use:

```javascript
var tape = new Tar();
```

Then all you got to do is call `tape.append` with your params and it'll be added to the archive. That's it!

Expand Down
17 changes: 15 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,23 @@
},
"author": "T. Jameson Little <t.jameson.little@gmail.com>",
"main": "lib/tar.js",
"keywords": ["tar", "browser", "client", "offline"],
"keywords": [
"tar",
"browser",
"client",
"offline"
],
"directories": {
"lib": "lib"
},
"dependencies": {
"dependencies": {},
"devDependencies": {
"webpack": "^2.6.1"
},
"scripts": {
"prepublish": "npm run build",
"build": "npm run build:dev && npm run build:prod",
"build:dev": "webpack",
"build:prod": "NODE_ENV=production webpack"
}
}
19 changes: 19 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const webpack = require('webpack');

const debug = process.env.NODE_ENV !== 'production';
const filename = debug ? 'tar.js' : 'tar.min.js';

module.exports = {
entry: __dirname + '/lib/tar.js',
output: {
path: __dirname + '/dist',
filename,
library: 'Tar',
},
module: {
loaders: [],
},
plugins: debug ? [] : [
new webpack.optimize.UglifyJsPlugin(),
],
};