承接 legionth/indentation-react 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

legionth/indentation-react

Composer 安装命令:

composer require legionth/indentation-react

包简介

README 文档

README

This project should show how awesome streams are and why they should be used. This project use a combination of writable and readable streams. Checkout the Usage for more information.

Table of Contents

Usage

Indenter

The center of this project is the Indenter class. This class (obviously) indents the incomig stream into an outgoing stream. The Indenter is an EventEmitter and a ReadableStreamInterface. Because this class is a ReadableStreamInterface the indented data will be exposed on the same interface.

To use this data you have to pipe it into another stream, checkout the examples folder.

So what is the reason for this project? This project just shows how awesome the ReactPHP streams are. Streams can come in different sizes: bigger parts, smaller parts, etc. depending on your data source(Downloads, Files, Strings ...). In this project you can be sure a chunk is complete when the new line delimiter comes in, so the next line will be indented. So you can be sure the stream is always correctly indented.

You can find under examples how you can use this project. If you need a file to be indented you can pipe the file into the example.

$ cat words.txt | php examples/indentInput.php

This command can be started on its own.

$ php examples/indentInput.php

This example makes clear why this project should be used. You can indent a whole file with one little example. If you want, you can pipe a command output into this example to see how it works. Just try it.

You can use other indentation methods as the standard 4 spaces e.g. (Tabs, more or fewer spaces) by using it like this

$ cat words.txt | php examples/indentInput.php --tab 

or just add two spaces instead of four:

$ cat words.txt | php examples/indentInput.php --spaces 2

Use it in your production code like this;

$indenter = new Indenter($inputStream);
// or
$indenter = new Indenter($inputStream, $beginningString);

The $beginningString can be any kind of string. Whatever you prefer ;)

Install

The recommended way to install this library is through Composer. New to Composer?

This will install the latest supported version:

$ composer require legionth/indentation-react:^0.1

See also the CHANGELOG for details about version upgrades.

License

MIT

统计信息

  • 总下载量: 18
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-09-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固