0.1.47 • Published 2 years ago

ts-pipes v0.1.47

Weekly downloads
21
License
(MIT OR Apache-2....
Repository
github
Last release
2 years ago

TS Pipes

GitHub license

Pipe transformation utility functions for TypeScript/JavaScript inspired by Angular Pipes and ngx-pipes

Table of contents

Installation

  1. Use npm to install the package

    $ npm install ts-pipes --save 

Array

flatten

Usage:

import Pipe from 'ts-pipes';

const date = Pipe('date');
const now = new Date();
// timeAgo also supports moment.js objects
const lastWeek = moment().subtract(10, 'days');
<span>Updated: { date.timeAgo(now) }</span> <!-- Output: "just now" -->
<span>Updated: { date.timeAgo(lastWeek) }</span> <!-- Output: "last week" -->

String

repeat()

Repeats a string n times

Usage: string | repeat: times: [separator|optional]

<p>{{ 'example' | repeat: 3: '@' }}</p> <!-- Output: "example@example@example" -->

License

Forked from rollup-starter-lib.

Inspiration drawn from Angular pipes and ngx-pipes.

MIT License.

0.1.47

2 years ago

0.1.46

3 years ago

0.1.45

3 years ago

0.1.43

3 years ago

0.1.44

3 years ago

0.1.42

3 years ago

0.1.41

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago