Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danieldietrich/rich-string
A tag function that automatically aligns embedded multiline strings.
https://github.com/danieldietrich/rich-string
Last synced: about 1 month ago
JSON representation
A tag function that automatically aligns embedded multiline strings.
- Host: GitHub
- URL: https://github.com/danieldietrich/rich-string
- Owner: danieldietrich
- License: mit
- Created: 2019-09-13T17:51:09.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-16T06:02:17.000Z (almost 2 years ago)
- Last Synced: 2024-09-29T11:47:39.238Z (about 2 months ago)
- Language: JavaScript
- Size: 861 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
[![npm version](https://img.shields.io/npm/v/@danieldietrich/rich-string?logo=npm&style=flat-square)](https://www.npmjs.com/package/@danieldietrich/rich-string/)[![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/@danieldietrich/rich-string?style=flat-square)](https://snyk.io/test/npm/@danieldietrich/rich-string)[![minzipped size](https://img.shields.io/bundlephobia/minzip/@danieldietrich/rich-string?style=flat-square)](https://bundlephobia.com/result?p=@danieldietrich/rich-string@latest)
[![build](https://img.shields.io/travis/danieldietrich/rich-string?logo=github&style=flat-square)](https://travis-ci.org/danieldietrich/rich-string/)[![coverage](https://img.shields.io/codecov/c/github/danieldietrich/rich-string?style=flat-square)](https://codecov.io/gh/danieldietrich/rich-string/)
![Platform](https://img.shields.io/badge/platform-Node%20v10%20+%20Browser%20%28ES6%2fES2015%29-decc47?logo=TypeScript&style=flat-square)
[![Sponsor](https://img.shields.io/badge/GitHub-💖Sponsors-b5b7b9?logo=github&style=flat-square)](https://github.com/sponsors/danieldietrich)[![donate](https://img.shields.io/badge/Donate-PayPal-blue.svg?style=flat-square)](https://paypal.me/danieldietrich13)[![license](https://img.shields.io/github/license/danieldietrich/rich-string?style=flat-square)](https://opensource.org/licenses/MIT/)
[![Follow](https://img.shields.io/twitter/follow/danieldietrich?label=Follow&style=social)](https://twitter.com/danieldietrich/)# rich-string
A tag function that automatically aligns embedded multiline strings.
## Installation
```bash
npm i @danieldietrich/rich-string
```## Usage
The module supports ES6 _import_ and CommonJS _require_ style.
```ts
import s from '@danieldietrich/rich-string';/*
function sayHi(name) {
console.log('Hi ${name}, I hope you are doing well!');
}
*/
const res = generateSayHi(s`console.log('Hi \${name}, I hope you are doing well!');
`);
function generateSayHi(body: string): string {
return s`
function sayHi(name) {
${body}
}
`;
}
```---
Copyright © 2020 by [Daniel Dietrich]([email protected]). Released under the [MIT](https://opensource.org/licenses/MIT/) license.