.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / unist-util-remove-position / readme.md
1 # unist-util-remove-position
2
3 [![Build][build-badge]][build]
4 [![Coverage][coverage-badge]][coverage]
5 [![Downloads][downloads-badge]][downloads]
6 [![Size][size-badge]][size]
7 [![Sponsors][sponsors-badge]][collective]
8 [![Backers][backers-badge]][collective]
9 [![Chat][chat-badge]][chat]
10
11 [**unist**][unist] utility to remove [`position`][position]s from tree.
12
13 ## Install
14
15 [npm][]:
16
17 ```sh
18 npm install unist-util-remove-position
19 ```
20
21 ## Usage
22
23 ```js
24 var remark = require('remark')
25 var removePosition = require('unist-util-remove-position')
26
27 var tree = remark().parse('Some _emphasis_, **importance**, and `code`.')
28
29 removePosition(tree, true)
30
31 console.dir(tree, {depth: null})
32 ```
33
34 Yields:
35
36 ```js
37 {
38   type: 'root',
39   children: [
40     {
41       type: 'paragraph',
42       children: [
43         { type: 'text', value: 'Some ' },
44         {
45           type: 'emphasis',
46           children: [ { type: 'text', value: 'emphasis' } ]
47         },
48         { type: 'text', value: ', ' },
49         {
50           type: 'strong',
51           children: [ { type: 'text', value: 'importance' } ]
52         },
53         { type: 'text', value: ', and ' },
54         { type: 'inlineCode', value: 'code' },
55         { type: 'text', value: '.' }
56       ]
57     }
58   ]
59 }
60 ```
61
62 ## API
63
64 ### `removePosition(node[, force])`
65
66 Remove [`position`][position]s from [`node`][node].
67 If `force` is given, uses `delete`, otherwise, sets `position`s to `undefined`.
68
69 ###### Returns
70
71 The given `node`.
72
73 ## Contribute
74
75 See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get
76 started.
77 See [`support.md`][support] for ways to get help.
78
79 This project has a [Code of Conduct][coc].
80 By interacting with this repository, organisation, or community you agree to
81 abide by its terms.
82
83 ## License
84
85 [MIT][license] © [Titus Wormer][author]
86
87 <!-- Definitions -->
88
89 [build-badge]: https://img.shields.io/travis/syntax-tree/unist-util-remove-position.svg
90
91 [build]: https://travis-ci.org/syntax-tree/unist-util-remove-position
92
93 [coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-remove-position.svg
94
95 [coverage]: https://codecov.io/github/syntax-tree/unist-util-remove-position
96
97 [downloads-badge]: https://img.shields.io/npm/dm/unist-util-remove-position.svg
98
99 [downloads]: https://www.npmjs.com/package/unist-util-remove-position
100
101 [size-badge]: https://img.shields.io/bundlephobia/minzip/unist-util-remove-position.svg
102
103 [size]: https://bundlephobia.com/result?p=unist-util-remove-position
104
105 [sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
106
107 [backers-badge]: https://opencollective.com/unified/backers/badge.svg
108
109 [collective]: https://opencollective.com/unified
110
111 [chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
112
113 [chat]: https://spectrum.chat/unified/syntax-tree
114
115 [npm]: https://docs.npmjs.com/cli/install
116
117 [license]: license
118
119 [author]: https://wooorm.com
120
121 [contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md
122
123 [support]: https://github.com/syntax-tree/.github/blob/master/support.md
124
125 [coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md
126
127 [unist]: https://github.com/syntax-tree/unist
128
129 [position]: https://github.com/syntax-tree/unist#position
130
131 [node]: https://github.com/syntax-tree/unist#node