Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fredrb/codepen-downloader
Download showcase projects from codepen.io
https://github.com/fredrb/codepen-downloader
codepen command-line download-showcases tool unit-tested
Last synced: 2 months ago
JSON representation
Download showcase projects from codepen.io
- Host: GitHub
- URL: https://github.com/fredrb/codepen-downloader
- Owner: fredrb
- License: isc
- Created: 2016-03-07T09:16:33.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-02-23T16:32:00.000Z (almost 6 years ago)
- Last Synced: 2024-11-15T10:57:06.875Z (3 months ago)
- Topics: codepen, command-line, download-showcases, tool, unit-tested
- Language: JavaScript
- Size: 44.9 KB
- Stars: 56
- Watchers: 6
- Forks: 11
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- Contributing: contributing.md
- License: LICENSE
Awesome Lists containing this project
README
# Codepen Downloader
[![NPM Version][npm-image]][npm-url]
[![Build Status](https://travis-ci.org/fredrb/codepen-downloader.svg?branch=master)](https://travis-ci.org/fredrb/codepen-downloader)
[![NPM Downloads][npm-downloads]][npm-url]Codepen Downloader is a tool used to download showcases from [codepen](http://www.codepen.io) to your machine. This can be done either via a command line tool or from a provided download method.
### Install
It's recommended to install globally since it can be used as command line tool.
`npm install cpen -g`
You can then download any codepen with the following command:
`cpen download [destination]`
You can provide the full URL or only the codepen extension reference (e.g. `/samirc/pen/vGKoxj`)
### Reference:
##### Command line:
`cpen download /samirc/pen/vGKoxj resource`
This will download `.html` `.js` and `.css` files to `resource` folder.
##### cpen.Download(url, destination, onCompleteCallback, [options], [onTick]):
You can use this method to dynamically download codepen files.
```js
var cpen = require('cpen');cpen.download('/samirc/pen/vGKoxj', 'resource', function(err) {
if (err) throw err;
console.log('Download completed!');
});
```The options property is used to select which files should be downloaded. Example: `['html', 'css', 'js']`
```js
var cpen = require('cpen');cpen.download('/ge1doot/pen/aNVYPN', 'resource', function() {
if (err) throw err;
console.log('Downloaded JS file to folder');
}, {
targetFiles : ['js'],
includeDependencies : true
});```
#### Contributing
Want to contribute? [Check the recommendations](https://github.com/fredrb/codepen-downloader/blob/master/contributing.md).
[npm-image]: https://img.shields.io/npm/v/cpen.svg
[npm-downloads]: https://img.shields.io/npm/dm/cpen.svg
[npm-url]: https://npmjs.org/package/cpen