1 # unist-util-remove-position
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]
11 [**unist**][unist] utility to remove [`position`][position]s from tree.
18 npm install unist-util-remove-position
24 var remark = require('remark')
25 var removePosition = require('unist-util-remove-position')
27 var tree = remark().parse('Some _emphasis_, **importance**, and `code`.')
29 removePosition(tree, true)
31 console.dir(tree, {depth: null})
43 { type: 'text', value: 'Some ' },
46 children: [ { type: 'text', value: 'emphasis' } ]
48 { type: 'text', value: ', ' },
51 children: [ { type: 'text', value: 'importance' } ]
53 { type: 'text', value: ', and ' },
54 { type: 'inlineCode', value: 'code' },
55 { type: 'text', value: '.' }
64 ### `removePosition(node[, force])`
66 Remove [`position`][position]s from [`node`][node].
67 If `force` is given, uses `delete`, otherwise, sets `position`s to `undefined`.
75 See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get
77 See [`support.md`][support] for ways to get help.
79 This project has a [Code of Conduct][coc].
80 By interacting with this repository, organisation, or community you agree to
85 [MIT][license] © [Titus Wormer][author]
89 [build-badge]: https://img.shields.io/travis/syntax-tree/unist-util-remove-position.svg
91 [build]: https://travis-ci.org/syntax-tree/unist-util-remove-position
93 [coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-remove-position.svg
95 [coverage]: https://codecov.io/github/syntax-tree/unist-util-remove-position
97 [downloads-badge]: https://img.shields.io/npm/dm/unist-util-remove-position.svg
99 [downloads]: https://www.npmjs.com/package/unist-util-remove-position
101 [size-badge]: https://img.shields.io/bundlephobia/minzip/unist-util-remove-position.svg
103 [size]: https://bundlephobia.com/result?p=unist-util-remove-position
105 [sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
107 [backers-badge]: https://opencollective.com/unified/backers/badge.svg
109 [collective]: https://opencollective.com/unified
111 [chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
113 [chat]: https://spectrum.chat/unified/syntax-tree
115 [npm]: https://docs.npmjs.com/cli/install
119 [author]: https://wooorm.com
121 [contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md
123 [support]: https://github.com/syntax-tree/.github/blob/master/support.md
125 [coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md
127 [unist]: https://github.com/syntax-tree/unist
129 [position]: https://github.com/syntax-tree/unist#position
131 [node]: https://github.com/syntax-tree/unist#node