Skip to content

Commit

Permalink
Merge 35e5359 into 8171af3
Browse files Browse the repository at this point in the history
  • Loading branch information
gastonpereyra committed Aug 21, 2020
2 parents 8171af3 + 35e5359 commit 74df26f
Show file tree
Hide file tree
Showing 10 changed files with 3,306 additions and 108 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [1.0.0] 2020-08-20
### Added
- Press-F class
- Custom Error Names
94 changes: 57 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,78 @@
# Template NPM Packages
# Press F

![npm-template](https://user-images.githubusercontent.com/39351850/89736287-af2cd580-da3e-11ea-86f2-f1829c3fafdf.png)
![Build Status](https://github.com/gastonpereyra/press-f/workflows/Build%20Status/badge.svg)
[![Coverage Status](https://img.shields.io/coveralls/github/gastonpereyra/press-f/master.svg)](https://coveralls.io/r/gastonpereyra/press-f?branch=master)

## :loudspeaker: Description
This is a template repository to make easier configurate NPM package repositories
![npmF](https://user-images.githubusercontent.com/39351850/90847511-113fe180-e341-11ea-9676-12964f43a55a.png)

## :floppy_disk: Installation
## Description
When an Error happens, press "f" to pay respect. A funny replace to Error class.

Steps :walking: :
## Installation

1. :chestnut: In the *Top-Navbar*, at right corner, on *+*, click **new Repository**
```
npm i press-f
```

![New Repository](https://user-images.githubusercontent.com/39351850/89736268-83115480-da3e-11ea-988d-066ce80f88b9.png)
## Usage

2. :seedling: In *Repository Template*, open menu, click *npm-template*
### new F(message)

![Use Template](https://user-images.githubusercontent.com/39351850/89736261-7ee53700-da3e-11ea-855f-f6ef9162b609.png)
Replace of `new Error('some message')`

3. :four_leaf_clover: Fill the **Repository Name**
4. :blossom: Add a **Description**
5. :bouquet: Click **Create Repository**
```js
const F = require('press-f');

## :white_check_mark: Content
if(shouldNotHappen())
throw new F('This should not happen because i don\'t like it');

<details>
<summary><b> :bookmark: NPM - `package.json` </b></summary>
/*
output:
throw new F(This should not happen because i don\'t like it');
^
* `Mocha` and `Sinon` testings dependencies, and `test` / `test-ci` script
* `Nyc` coverage dependency, `.nycrc` file and `coverage` script
* `eslint` and `eslint-airbnb` linter dependencies and `.eslintrc.js` file
* `root/lib/` as file container
Press F: This should not happen because i don't like it
at ...
*/
```

</details>
### new F()

<details>
<summary><b> :bar_chart: Actions Workflows </b></summary>
Replace of `new Error()`

* Build Status to run tests, on every branches
* Coverage status to generate Coveralls badge on push and PR
* Linter status for push and PR
* NPM publish on releases
```js
const F = require('press-f');

</details>
if(shouldNotHappen())
throw new F();

<details>
<summary><b> :scroll: README Template </b></summary>
/*
output:
throw new F();
^
* Some Block pre-build
* Build Status and Coverage Status badges
* Must change `tpl` extension for `md`
Press F: Pay Respect
at ...
*/
```

</details>
### new F(message, name)

# :pencil: References
Replace of `new Error(message)` but change Error name for a custom one, if `name` is *string*

```js
const F = require('press-f');

if(shouldNotHappen())
throw new F('I don\'t care', 'This is not an Error');

/*
output:
throw new F();
^
This is not an Error: I don't care
at ...
*/
```

* Templates in :us: [Click HERE!!!!!](https://docs.github.com/en/github/managing-your-work-on-github/about-project-boards)
* Templates en :es: [Click ACA!!!!!](https://docs.github.com/es/github/creating-cloning-and-archiving-repositories/creating-a-template-repository)
27 changes: 0 additions & 27 deletions README.tpl

This file was deleted.

3 changes: 0 additions & 3 deletions lib/PACKAGE_NAME.js

This file was deleted.

10 changes: 10 additions & 0 deletions lib/f.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
'use strict';

module.exports = class F extends Error {

constructor(error, name) {
super(error || 'Pay Respect');

this.name = typeof name === 'string' ? name : 'Press F';
}
};
7 changes: 0 additions & 7 deletions lib/index.js

This file was deleted.

0 comments on commit 74df26f

Please sign in to comment.