https://github.com/amireh/multiline-slash
JavaScript multi-line strings using // as a commentor.
https://github.com/amireh/multiline-slash
Last synced: 3 months ago
JSON representation
JavaScript multi-line strings using // as a commentor.
- Host: GitHub
- URL: https://github.com/amireh/multiline-slash
- Owner: amireh
- Created: 2016-04-12T00:28:43.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-12T00:28:56.000Z (about 9 years ago)
- Last Synced: 2025-02-13T01:08:17.703Z (4 months ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# multiline-slash
A JavaScript function that allows you to write multi-line strings.
This is different than [multiline](https://www.npmjs.com/package/multiline) in that it allows you to use `/* */` inside the string, for things like parsing comments and such.
## Example```javascript
var multiline = require('multiline-slash');var str = multiline(function() {
// Hello
// World!
});console.assert(str === 'Hello\nWorld!');
``````javascript
var multiline = require('multiline-slash');multiline(function() {
// /**
// * Hello World!
// */
});console.assert(str === '/**\n Hello World!\n*/');
```You can remove padding too:
```javascript
var multiline = require('multiline-slash');var str = multiline(function() {
// Hello
}, true);console.assert(str === 'Hello');
```## Installation
```bash
npm install multiline-slash
```