https://github.com/renjithspace/pre.js
Pure JavaScript plugin for preserves spaces and line breaks
https://github.com/renjithspace/pre.js
javascript line-break newline preserver spaces
Last synced: about 2 months ago
JSON representation
Pure JavaScript plugin for preserves spaces and line breaks
- Host: GitHub
- URL: https://github.com/renjithspace/pre.js
- Owner: renjithspace
- Created: 2017-07-19T16:14:42.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-30T15:07:42.000Z (over 6 years ago)
- Last Synced: 2025-03-05T05:47:49.314Z (2 months ago)
- Topics: javascript, line-break, newline, preserver, spaces
- Language: HTML
- Homepage: https://git.io/vFUhQ
- Size: 27.3 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pre.js
Pure JavaScript plugin for preserves spaces and line breaks## Installation
**NPM**
```sh
npm install pre.js --save
```
**In Node.js:**
```js
require('pre.js')
```
**Bower**
```sh
bower install pre.js --save
```
**Direct download** from [latest releases](https://github.com/renjithvk/pre.js/releases)## Usage
**Include**
```js```
**Initialize**
```js
new Pre();
```## Config
```js
new Pre({
// Options here
property: value,
...
});
```## Options
| Property | Description | Available values | Default value |
|----------|--------------------------------------|---------------------------|---------------|
| el | Pre.js element | Element selector (string) | '.pre' |
| spaces | Enable/Disable spaces preserver | true, false(boolean) | false |
| newlines | Enable/Disable line breaks preserver | true, false (boolean) | true |## Contribution
1. Fork and clone the repository
2. Install development dependencies ```npm install```
3. Contribute
4. Build ```npm run build```
5. Commit and push
6. Do pull request