How to use the charsets function from mime-types
Find comprehensive JavaScript mime-types.charsets code examples handpicked from public code repositorys.
GitHub: sintaxi/harp
129 130 131 132 133 134 135 136 137 138
if(error) return next(error) if(!body) return next() // 404 var outputType = terraform.helpers.outputType(sourceFile) var mimeType = helpers.mimeType(outputType) var charset = mime.charsets.lookup(mimeType) rsp.statusCode = 200 rsp.setHeader('Content-Type', mimeType + (charset ? '; charset=' + charset : '')) rsp.setHeader('Content-Length', Buffer.byteLength(body, charset)); rsp.end(body)
373
0
111
mime-types.lookup is the most popular function in mime-types (261 examples)