Skip to content

Commit

Permalink
翻译README
Browse files Browse the repository at this point in the history
  • Loading branch information
chilingling committed Apr 1, 2019
1 parent a5cc11e commit 585ad1c
Show file tree
Hide file tree
Showing 2 changed files with 176 additions and 46 deletions.
124 changes: 124 additions & 0 deletions README-zh_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# [extend](https://github.com/jsmini/extend)

[![](https://img.shields.io/badge/Powered%20by-jslib%20extend-brightgreen.svg)](https://github.com/yanhaijing/jslib-extend)
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/jsmini/extend/blob/master/LICENSE)
[![Build Status](https://travis-ci.org/jsmini/extend.svg?branch=master)](https://travis-ci.org/jsmini/extend)
[![npm](https://img.shields.io/badge/npm-0.3.1-orange.svg)](https://www.npmjs.com/package/@jsmini/extend)
[![NPM downloads](http://img.shields.io/npm/dm/@jsmini/extend.svg?style=flat-square)](http://www.npmtrends.com/@jsmini/extend)
[![Percentage of issues still open](http://isitmaintained.com/badge/open/jsmini/extend.svg)](http://isitmaintained.com/project/jsmini/extend "Percentage of issues still open")

将对象属性递归放到目标对象,类似jQuery的`$.extend`

[English](./README.md) | 简体中文
## 兼容性
单元测试保证支持如下环境:

| IE | CH | FF | SF | OP | IOS | 安卓 | Node |
| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----- |
| 6+ | 23+ | 4+ | 6+ | 10+ | 5+ | 2.3+ | 0.10+ |

## 目录介绍

```
.
├── demo 使用demo
├── dist 编译产出代码
├── doc 项目文档
├── src 源代码目录
├── test 单元测试
├── CHANGELOG.md 变更日志
└── TODO.md 计划功能
```

## 如何使用
通过npm下载安装代码

```bash
$ npm install --save @jsmini/extend
```

如果你是node环境

```js
var name = require('@jsmini/extend').name;
```

如果你是webpack等环境

```js
import { name } from '@jsmini/extend';
```

如果你是requirejs环境

```js
requirejs(['node_modules/@jsmini/extend/dist/index.aio.js'], function (jsmini_extend) {
var name = jsmini_extend.name;
})
```

如果你是浏览器环境

```html
<script src="node_modules/@jsmini/extend/dist/index.aio.js"></script>

<script>
var name = jsmini_extend.name;
</script>
```

## 文档
[API](https://github.com/jsmini/extend/blob/master/doc/api.md)

## 贡献指南 ![PRs welcome](<https://img.shields.io/badge/PRs-welcome-brightgreen.svg>)
首次运行需要先安装依赖

```bash
$ npm install
```

一键打包生成生产代码

```bash
$ npm run build
```

运行单元测试,浏览器环境需要手动测试,位于`test/browser`

```bash
$ npm test
```

修改package.json中的版本号,修改README.md中的版本号,修改CHANGELOG.md,然后发布新版

```bash
$ npm run release
```

将新版本发布到npm

```bash
$ npm publish --access=public
```

重命名项目名称,首次初始化项目是需要修改名字,或者后面项目要改名时使用,需要修改`rename.js`中的`fromName``toName`,会自动重命名下面文件中的名字

- README.md 中的信息
- package.json 中的信息
- config/rollup.js 中的信息
- test/browser/index.html 中的仓库名称

```bash
$ npm run rename # 重命名命令
```

## 贡献者列表
[contributors](https://github.com/jsmini/extend/graphs/contributors)

## 更新日志
[CHANGELOG.md](https://github.com/jsmini/extend/blob/master/CHANGELOG.md)

## 计划列表
[TODO.md](https://github.com/jsmini/extend/blob/master/TODO.md)

## 谁在使用
98 changes: 52 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,117 +7,123 @@
[![NPM downloads](http://img.shields.io/npm/dm/@jsmini/extend.svg?style=flat-square)](http://www.npmtrends.com/@jsmini/extend)
[![Percentage of issues still open](http://isitmaintained.com/badge/open/jsmini/extend.svg)](http://isitmaintained.com/project/jsmini/extend "Percentage of issues still open")

A method like `$.extend` of Jquery. Merge Objects attributes to target object

将对象属性递归放到目标对象,类似jQuery的`$.extend`

## 兼容性
单元测试保证支持如下环境:
English | [简体中文](./README-zh_CN.md)

## Environment Support

| IE | CH | FF | SF | OP | IOS | 安卓 | Node |
| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----- |
| 6+ | 23+ | 4+ | 6+ | 10+ | 5+ | 2.3+ | 0.10+ |
unit test ensure it supports the following environments.

## 目录介绍
| IE/Edge | Chrome | Firefox | Safari | Opera | IOS | Android | Node |
| ------- | ------ | ------- | ------ | ----- | ---- | ------- | ----- |
| 6+ | 23+ | 4+ | 6+ | 10+ | 5+ | 2.3+ | 0.10+ |

## Directory

```
.
├── demo 使用demo
├── dist 编译产出代码
├── doc 项目文档
├── src 源代码目录
├── test 单元测试
├── CHANGELOG.md 变更日志
└── TODO.md 计划功能
├── demo
├── dist # production code
├── doc # document
├── src # source code
├── test # unit test
├── CHANGELOG.md
└── TODO.md
```

## 如何使用
通过npm下载安装代码
## Usage
npm installation

```bash
$ npm install --save @jsmini/extend
$ npm install --save @jsmini/clone
```

如果你是node环境
Node.js

```js
var name = require('@jsmini/extend').name;
var name = require('@jsmini/clone').name;
```

如果你是webpack等环境
webpack

```js
import { name } from '@jsmini/extend';
import { name } from '@jsmini/clone';
```

如果你是requirejs环境
Require.js

```js
requirejs(['node_modules/@jsmini/extend/dist/index.aio.js'], function (jsmini_extend) {
var name = jsmini_extend.name;
requirejs(['node_modules/@jsmini/clone/dist/index.aio.js'], function (jsmini_clone) {
var name = jsmini_clone.name;
})
```

如果你是浏览器环境
Browser

```html
<script src="node_modules/@jsmini/extend/dist/index.aio.js"></script>
<script src="node_modules/@jsmini/clone/dist/index.aio.js"></script>

<script>
var name = jsmini_extend.name;
var name = jsmini_clone.name;
</script>
```

## 文档
## Document

[API](https://github.com/jsmini/extend/blob/master/doc/api.md)

## 贡献指南
首次运行需要先安装依赖
## Contributing Guide ![PRs welcome](<https://img.shields.io/badge/PRs-welcome-brightgreen.svg>)
when initialize, install dependencies

```bash
$ npm install
```

一键打包生成生产代码
builds your code for production to `build` folder

```bash
$ npm run build
```

运行单元测试,浏览器环境需要手动测试,位于`test/browser`
run unit test. notice: borwser enviroment need to test manually. test file is in `test/browser`

```bash
$ npm test
```

修改package.json中的版本号,修改README.md中的版本号,修改CHANGELOG.md,然后发布新版
change the version in package.json and README.md, add your description in CHANGELOG.md, and then release it happily.

```bash
$ npm run release
```

将新版本发布到npm
publish the new package to npm

```bash
$ npm publish --access=public
```

重命名项目名称,首次初始化项目是需要修改名字,或者后面项目要改名时使用,需要修改`rename.js`中的`fromName``toName`,会自动重命名下面文件中的名字
rename project. you need to edit project name when initialize project or anytime you want to rename the project . you need to rename `formName` and `toname` in file `rename.js`,which will automatically rename project name in the following files

- README.md 中的信息
- package.json 中的信息
- config/rollup.js 中的信息
- test/browser/index.html 中的仓库名称
- README.md
- package.json
- config/rollup.js
- test/browser/index.html

```bash
$ npm run rename # 重命名命令
$ npm run rename # rename command
```

## 贡献者列表
[contributors](https://github.com/jsmini/extend/graphs/contributors)
## Contributors
[contributors](https://github.com/jsmini/clone/graphs/contributors)

## 更新日志
[CHANGELOG.md](https://github.com/jsmini/extend/blob/master/CHANGELOG.md)
## CHANGELOG
[CHANGELOG.md](https://github.com/jsmini/clone/blob/master/CHANGELOG.md)

## 计划列表
[TODO.md](https://github.com/jsmini/extend/blob/master/TODO.md)
## TODO
[TODO.md](https://github.com/jsmini/clone/blob/master/TODO.md)

## 谁在使用
## who is using

0 comments on commit 585ad1c

Please sign in to comment.