Skip to content

Commit b34feee

Browse files
committed
doc refactor: zlib
1 parent 169b082 commit b34feee

File tree

1 file changed

+33
-25
lines changed

1 file changed

+33
-25
lines changed

doc/api/zlib.markdown

+33-25
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Zlib
1+
# Zlib
22

33
You can access this module with:
44

@@ -8,7 +8,7 @@ This provides bindings to Gzip/Gunzip, Deflate/Inflate, and
88
DeflateRaw/InflateRaw classes. Each class takes the same options, and
99
is a readable/writable Stream.
1010

11-
### Examples
11+
## Examples
1212

1313
Compressing or decompressing a file can be done by piping an
1414
fs.ReadStream into a zlib stream, then into an fs.WriteStream.
@@ -101,109 +101,115 @@ tradeoffs involved in zlib usage.
101101
}
102102
}).listen(1337);
103103

104-
### Constants
104+
## Constants
105+
106+
<!--type=misc-->
105107

106108
All of the constants defined in zlib.h are also defined on
107109
`require('zlib')`. They are described in more detail in the zlib
108110
documentation. See <http://zlib.net/manual.html#Constants>
109111
for more details.
110112

111-
### zlib.createGzip([options])
113+
## zlib.createGzip([options])
112114

113115
Returns a new [Gzip](#zlib.Gzip) object with an [options](#options).
114116

115-
### zlib.createGunzip([options])
117+
## zlib.createGunzip([options])
116118

117119
Returns a new [Gunzip](#zlib.Gunzip) object with an [options](#options).
118120

119-
### zlib.createDeflate([options])
121+
## zlib.createDeflate([options])
120122

121123
Returns a new [Deflate](#zlib.Deflate) object with an [options](#options).
122124

123-
### zlib.createInflate([options])
125+
## zlib.createInflate([options])
124126

125127
Returns a new [Inflate](#zlib.Inflate) object with an [options](#options).
126128

127-
### zlib.createDeflateRaw([options])
129+
## zlib.createDeflateRaw([options])
128130

129131
Returns a new [DeflateRaw](#zlib.DeflateRaw) object with an [options](#options).
130132

131-
### zlib.createInflateRaw([options])
133+
## zlib.createInflateRaw([options])
132134

133135
Returns a new [InflateRaw](#zlib.InflateRaw) object with an [options](#options).
134136

135-
### zlib.createUnzip([options])
137+
## zlib.createUnzip([options])
136138

137139
Returns a new [Unzip](#zlib.Unzip) object with an [options](#options).
138140

139141

140-
### zlib.Gzip
142+
## Class: zlib.Gzip
141143

142144
Compress data using gzip.
143145

144-
### zlib.Gunzip
146+
## Class: zlib.Gunzip
145147

146148
Decompress a gzip stream.
147149

148-
### zlib.Deflate
150+
## Class: zlib.Deflate
149151

150152
Compress data using deflate.
151153

152-
### zlib.Inflate
154+
## Class: zlib.Inflate
153155

154156
Decompress a deflate stream.
155157

156-
### zlib.DeflateRaw
158+
## Class: zlib.DeflateRaw
157159

158160
Compress data using deflate, and do not append a zlib header.
159161

160-
### zlib.InflateRaw
162+
## Class: zlib.InflateRaw
161163

162164
Decompress a raw deflate stream.
163165

164-
### zlib.Unzip
166+
## Class: zlib.Unzip
165167

166168
Decompress either a Gzip- or Deflate-compressed stream by auto-detecting
167169
the header.
168170

169171
## Convenience Methods
170172

173+
<!--type=misc-->
174+
171175
All of these take a string or buffer as the first argument, and call the
172176
supplied callback with `callback(error, result)`. The
173177
compression/decompression engine is created using the default settings
174178
in all convenience methods. To supply different options, use the
175179
zlib classes directly.
176180

177-
### zlib.deflate(buf, callback)
181+
## zlib.deflate(buf, callback)
178182

179183
Compress a string with Deflate.
180184

181-
### zlib.deflateRaw(buf, callback)
185+
## zlib.deflateRaw(buf, callback)
182186

183187
Compress a string with DeflateRaw.
184188

185-
### zlib.gzip(buf, callback)
189+
## zlib.gzip(buf, callback)
186190

187191
Compress a string with Gzip.
188192

189-
### zlib.gunzip(buf, callback)
193+
## zlib.gunzip(buf, callback)
190194

191195
Decompress a raw Buffer with Gunzip.
192196

193-
### zlib.inflate(buf, callback)
197+
## zlib.inflate(buf, callback)
194198

195199
Decompress a raw Buffer with Inflate.
196200

197-
### zlib.inflateRaw(buf, callback)
201+
## zlib.inflateRaw(buf, callback)
198202

199203
Decompress a raw Buffer with InflateRaw.
200204

201-
### zlib.unzip(buf, callback)
205+
## zlib.unzip(buf, callback)
202206

203207
Decompress a raw Buffer with Unzip.
204208

205209
## Options
206210

211+
<!--type=misc-->
212+
207213
Each class takes an options object. All options are optional. (The
208214
convenience methods use the default settings for all options.)
209215

@@ -219,7 +225,9 @@ relevant when compressing, and are ignored by the decompression classes.
219225
See the description of `deflateInit2` and `inflateInit2` at
220226
<http://zlib.net/manual.html#Advanced> for more information on these.
221227

222-
### Memory Usage Tuning
228+
## Memory Usage Tuning
229+
230+
<!--type=misc-->
223231

224232
From `zlib/zconf.h`, modified to node's usage:
225233

0 commit comments

Comments
 (0)