@opennd/lib
v0.0.18
Published
```bash npm i @opennd/lib --save ``` [API Docs](https://opennd-lib.pages.dev/pages/Node/lib.html)
Downloads
32
Readme
@opennd/lib
Install
npm i @opennd/lib --save
Example
import { excelCursorStream } from '@opennd/lib'
const model = mongoose.model('xxx', new Schema({
name: String,
age: Number
}))
router.get('/xxx', (req, res) => {
const cursor = model.find().cursor()
await excelCursorStream({
res,
req,
cursor,
merges: ['A1:B1'],
headers: [
[
{ title: '真是帅的表格标题' },
],
[
{ title: '姓名', dataIndex: 'name', width: 20 },
{ title: '年龄', dataIndex: 'age', width: 10 },
],
],
})
})