ai 1.1.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +10 -24
- package/dist/ai-stream.d.ts +18 -0
- package/dist/ai-stream.js +132 -0
- package/dist/ai-stream.mjs +13 -0
- package/dist/anthropic-stream.d.ts +5 -0
- package/dist/anthropic-stream.js +133 -0
- package/dist/anthropic-stream.mjs +8 -0
- package/dist/chunk-265FSSO4.mjs +91 -0
- package/dist/chunk-2L3ZO4UM.mjs +45 -0
- package/dist/chunk-GT4HKF2X.mjs +33 -0
- package/dist/chunk-JGDC3BXD.mjs +22 -0
- package/dist/chunk-NK2CVBLI.mjs +38 -0
- package/dist/chunk-PEYAHBDF.mjs +43 -0
- package/dist/chunk-TJMME6CL.mjs +24 -0
- package/dist/huggingface-stream.d.ts +5 -0
- package/dist/huggingface-stream.js +121 -0
- package/dist/huggingface-stream.mjs +8 -0
- package/dist/index.d.ts +131 -0
- package/dist/index.js +278 -0
- package/dist/index.mjs +35 -0
- package/dist/index.test.d.ts +2 -0
- package/dist/index.test.js +12 -0
- package/dist/index.test.mjs +10 -0
- package/dist/langchain-stream.d.ts +12 -0
- package/dist/langchain-stream.js +102 -0
- package/dist/langchain-stream.mjs +8 -0
- package/dist/openai-stream.d.ts +5 -0
- package/dist/openai-stream.js +144 -0
- package/dist/openai-stream.mjs +8 -0
- package/dist/streaming-text-response.d.ts +17 -0
- package/dist/streaming-text-response.js +75 -0
- package/dist/streaming-text-response.mjs +9 -0
- package/package.json +78 -29
- package/react/dist/chunk-5PP6W52J.mjs +202 -0
- package/react/dist/chunk-6EH3SWMP.mjs +55 -0
- package/react/dist/chunk-PW6HSU2N.mjs +154 -0
- package/react/dist/index.d.ts +3 -0
- package/react/dist/index.js +424 -0
- package/react/dist/index.mjs +12 -0
- package/react/dist/types-f862f74a.d.ts +123 -0
- package/react/dist/use-chat.d.ts +42 -0
- package/react/dist/use-chat.js +276 -0
- package/react/dist/use-chat.mjs +8 -0
- package/react/dist/use-completion.d.ts +47 -0
- package/react/dist/use-completion.js +229 -0
- package/react/dist/use-completion.mjs +8 -0
- package/svelte/dist/chunk-6USBQIV6.mjs +177 -0
- package/svelte/dist/chunk-BQ64GHZ3.mjs +136 -0
- package/svelte/dist/chunk-CENOSGDG.mjs +493 -0
- package/svelte/dist/index.d.ts +4 -0
- package/svelte/dist/index.js +808 -0
- package/svelte/dist/index.mjs +11 -0
- package/svelte/dist/types-f862f74a.d.ts +123 -0
- package/svelte/dist/use-chat.d.ts +39 -0
- package/svelte/dist/use-chat.js +680 -0
- package/svelte/dist/use-chat.mjs +7 -0
- package/svelte/dist/use-completion.d.ts +38 -0
- package/svelte/dist/use-completion.js +640 -0
- package/svelte/dist/use-completion.mjs +7 -0
- package/.npmignore +0 -15
- package/.travis.yml +0 -4
- package/README.md +0 -21
- package/bin/ai.js +0 -22
- package/index.js +0 -37
- package/node_modules/request/.npmignore +0 -2
- package/node_modules/request/.travis.yml +0 -12
- package/node_modules/request/CHANGELOG.md +0 -954
- package/node_modules/request/LICENSE +0 -55
- package/node_modules/request/README.md +0 -421
- package/node_modules/request/index.js +0 -166
- package/node_modules/request/lib/cookies.js +0 -40
- package/node_modules/request/lib/copy.js +0 -8
- package/node_modules/request/lib/debug.js +0 -7
- package/node_modules/request/lib/getSafe.js +0 -34
- package/node_modules/request/lib/optional.js +0 -5
- package/node_modules/request/node_modules/aws-sign2/LICENSE +0 -55
- package/node_modules/request/node_modules/aws-sign2/README.md +0 -4
- package/node_modules/request/node_modules/aws-sign2/index.js +0 -202
- package/node_modules/request/node_modules/aws-sign2/package.json +0 -47
- package/node_modules/request/node_modules/forever-agent/LICENSE +0 -55
- package/node_modules/request/node_modules/forever-agent/README.md +0 -4
- package/node_modules/request/node_modules/forever-agent/index.js +0 -119
- package/node_modules/request/node_modules/forever-agent/package.json +0 -46
- package/node_modules/request/node_modules/form-data/License +0 -19
- package/node_modules/request/node_modules/form-data/Readme.md +0 -175
- package/node_modules/request/node_modules/form-data/lib/form_data.js +0 -351
- package/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml +0 -3
- package/node_modules/request/node_modules/form-data/node_modules/async/LICENSE +0 -19
- package/node_modules/request/node_modules/form-data/node_modules/async/README.md +0 -1646
- package/node_modules/request/node_modules/form-data/node_modules/async/component.json +0 -11
- package/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js +0 -1123
- package/node_modules/request/node_modules/form-data/node_modules/async/package.json +0 -60
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/License +0 -19
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md +0 -132
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js +0 -186
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore +0 -2
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License +0 -19
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile +0 -7
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md +0 -154
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js +0 -99
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json +0 -42
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js +0 -6
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js +0 -38
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js +0 -21
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js +0 -14
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js +0 -48
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js +0 -15
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js +0 -18
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js +0 -13
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js +0 -13
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js +0 -7
- package/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json +0 -61
- package/node_modules/request/node_modules/form-data/node_modules/mime/LICENSE +0 -19
- package/node_modules/request/node_modules/form-data/node_modules/mime/README.md +0 -66
- package/node_modules/request/node_modules/form-data/node_modules/mime/mime.js +0 -114
- package/node_modules/request/node_modules/form-data/node_modules/mime/package.json +0 -59
- package/node_modules/request/node_modules/form-data/node_modules/mime/test.js +0 -84
- package/node_modules/request/node_modules/form-data/node_modules/mime/types/mime.types +0 -1588
- package/node_modules/request/node_modules/form-data/node_modules/mime/types/node.types +0 -77
- package/node_modules/request/node_modules/form-data/package.json +0 -80
- package/node_modules/request/node_modules/hawk/.npmignore +0 -18
- package/node_modules/request/node_modules/hawk/.travis.yml +0 -5
- package/node_modules/request/node_modules/hawk/LICENSE +0 -24
- package/node_modules/request/node_modules/hawk/Makefile +0 -10
- package/node_modules/request/node_modules/hawk/README.md +0 -625
- package/node_modules/request/node_modules/hawk/example/usage.js +0 -78
- package/node_modules/request/node_modules/hawk/images/hawk.png +0 -0
- package/node_modules/request/node_modules/hawk/images/logo.png +0 -0
- package/node_modules/request/node_modules/hawk/index.js +0 -1
- package/node_modules/request/node_modules/hawk/lib/browser.js +0 -507
- package/node_modules/request/node_modules/hawk/lib/client.js +0 -371
- package/node_modules/request/node_modules/hawk/lib/crypto.js +0 -118
- package/node_modules/request/node_modules/hawk/lib/index.js +0 -15
- package/node_modules/request/node_modules/hawk/lib/server.js +0 -523
- package/node_modules/request/node_modules/hawk/lib/utils.js +0 -183
- package/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore +0 -18
- package/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml +0 -5
- package/node_modules/request/node_modules/hawk/node_modules/boom/LICENSE +0 -24
- package/node_modules/request/node_modules/hawk/node_modules/boom/Makefile +0 -11
- package/node_modules/request/node_modules/hawk/node_modules/boom/README.md +0 -6
- package/node_modules/request/node_modules/hawk/node_modules/boom/images/boom.png +0 -0
- package/node_modules/request/node_modules/hawk/node_modules/boom/index.js +0 -1
- package/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js +0 -207
- package/node_modules/request/node_modules/hawk/node_modules/boom/package.json +0 -64
- package/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js +0 -245
- package/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore +0 -18
- package/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml +0 -5
- package/node_modules/request/node_modules/hawk/node_modules/cryptiles/LICENSE +0 -24
- package/node_modules/request/node_modules/hawk/node_modules/cryptiles/Makefile +0 -11
- package/node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md +0 -6
- package/node_modules/request/node_modules/hawk/node_modules/cryptiles/index.js +0 -1
- package/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js +0 -68
- package/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json +0 -65
- package/node_modules/request/node_modules/hawk/node_modules/cryptiles/test/index.js +0 -101
- package/node_modules/request/node_modules/hawk/node_modules/hoek/.npmignore +0 -18
- package/node_modules/request/node_modules/hawk/node_modules/hoek/.travis.yml +0 -5
- package/node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE +0 -33
- package/node_modules/request/node_modules/hawk/node_modules/hoek/Makefile +0 -10
- package/node_modules/request/node_modules/hawk/node_modules/hoek/README.md +0 -436
- package/node_modules/request/node_modules/hawk/node_modules/hoek/images/hoek.png +0 -0
- package/node_modules/request/node_modules/hawk/node_modules/hoek/index.js +0 -1
- package/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js +0 -132
- package/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js +0 -585
- package/node_modules/request/node_modules/hawk/node_modules/hoek/package.json +0 -70
- package/node_modules/request/node_modules/hawk/node_modules/hoek/test/escaper.js +0 -86
- package/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js +0 -1078
- package/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test1.js +0 -1
- package/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test2.js +0 -1
- package/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test3.js +0 -1
- package/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore +0 -18
- package/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml +0 -5
- package/node_modules/request/node_modules/hawk/node_modules/sntp/LICENSE +0 -24
- package/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile +0 -11
- package/node_modules/request/node_modules/hawk/node_modules/sntp/README.md +0 -68
- package/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js +0 -16
- package/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js +0 -25
- package/node_modules/request/node_modules/hawk/node_modules/sntp/index.js +0 -1
- package/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js +0 -409
- package/node_modules/request/node_modules/hawk/node_modules/sntp/package.json +0 -65
- package/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js +0 -359
- package/node_modules/request/node_modules/hawk/package.json +0 -70
- package/node_modules/request/node_modules/hawk/test/browser.js +0 -817
- package/node_modules/request/node_modules/hawk/test/client.js +0 -206
- package/node_modules/request/node_modules/hawk/test/crypto.js +0 -86
- package/node_modules/request/node_modules/hawk/test/index.js +0 -316
- package/node_modules/request/node_modules/hawk/test/message.js +0 -246
- package/node_modules/request/node_modules/hawk/test/readme.js +0 -98
- package/node_modules/request/node_modules/hawk/test/server.js +0 -686
- package/node_modules/request/node_modules/hawk/test/uri.js +0 -456
- package/node_modules/request/node_modules/hawk/test/utils.js +0 -120
- package/node_modules/request/node_modules/http-signature/.dir-locals.el +0 -6
- package/node_modules/request/node_modules/http-signature/.npmignore +0 -7
- package/node_modules/request/node_modules/http-signature/LICENSE +0 -18
- package/node_modules/request/node_modules/http-signature/README.md +0 -75
- package/node_modules/request/node_modules/http-signature/http_signing.md +0 -296
- package/node_modules/request/node_modules/http-signature/lib/index.js +0 -25
- package/node_modules/request/node_modules/http-signature/lib/parser.js +0 -304
- package/node_modules/request/node_modules/http-signature/lib/signer.js +0 -179
- package/node_modules/request/node_modules/http-signature/lib/util.js +0 -249
- package/node_modules/request/node_modules/http-signature/lib/verify.js +0 -42
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore +0 -2
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE +0 -19
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md +0 -50
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js +0 -13
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js +0 -27
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js +0 -267
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js +0 -36
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js +0 -317
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js +0 -20
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json +0 -63
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js +0 -172
- package/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js +0 -296
- package/node_modules/request/node_modules/http-signature/node_modules/assert-plus/README.md +0 -126
- package/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js +0 -196
- package/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json +0 -38
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG +0 -71
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE +0 -24
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/README +0 -82
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old +0 -298
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js +0 -245
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js +0 -1485
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js +0 -944
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype +0 -241
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json +0 -36
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf +0 -129
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle +0 -839
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/float.json +0 -13
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/int.json +0 -13
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/psinfo.json +0 -104
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/struct.json +0 -19
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.fail.js +0 -39
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.float.js +0 -14
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.int.js +0 -14
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.psinfo.js +0 -17
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.struct.js +0 -18
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.typedef.js +0 -15
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/typedef.json +0 -14
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.rfloat.js +0 -767
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.wfloat.js +0 -753
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.64.js +0 -638
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.rint.js +0 -101
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wbounds.js +0 -53
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wint.js +0 -92
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.64.js +0 -451
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.roundtrip.js +0 -81
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.ruint.js +0 -95
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.wuint.js +0 -156
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicr.js +0 -50
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicw.js +0 -44
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.char.js +0 -42
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.endian.js +0 -45
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.oldwrite.js +0 -28
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.readSize.js +0 -128
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.structw.js +0 -28
- package/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.writeStruct.js +0 -31
- package/node_modules/request/node_modules/http-signature/package.json +0 -54
- package/node_modules/request/node_modules/json-stringify-safe/LICENSE +0 -27
- package/node_modules/request/node_modules/json-stringify-safe/README.md +0 -49
- package/node_modules/request/node_modules/json-stringify-safe/package.json +0 -51
- package/node_modules/request/node_modules/json-stringify-safe/stringify.js +0 -39
- package/node_modules/request/node_modules/json-stringify-safe/test.js +0 -128
- package/node_modules/request/node_modules/mime-types/.npmignore +0 -14
- package/node_modules/request/node_modules/mime-types/.travis.yml +0 -12
- package/node_modules/request/node_modules/mime-types/LICENSE +0 -22
- package/node_modules/request/node_modules/mime-types/Makefile +0 -9
- package/node_modules/request/node_modules/mime-types/README.md +0 -101
- package/node_modules/request/node_modules/mime-types/SOURCES.md +0 -17
- package/node_modules/request/node_modules/mime-types/component.json +0 -16
- package/node_modules/request/node_modules/mime-types/lib/custom.json +0 -27
- package/node_modules/request/node_modules/mime-types/lib/index.js +0 -75
- package/node_modules/request/node_modules/mime-types/lib/mime.json +0 -3317
- package/node_modules/request/node_modules/mime-types/lib/node.json +0 -55
- package/node_modules/request/node_modules/mime-types/package.json +0 -69
- package/node_modules/request/node_modules/node-uuid/.npmignore +0 -2
- package/node_modules/request/node_modules/node-uuid/LICENSE.md +0 -2
- package/node_modules/request/node_modules/node-uuid/README.md +0 -207
- package/node_modules/request/node_modules/node-uuid/benchmark/README.md +0 -53
- package/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu +0 -174
- package/node_modules/request/node_modules/node-uuid/benchmark/bench.sh +0 -34
- package/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c +0 -34
- package/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js +0 -84
- package/node_modules/request/node_modules/node-uuid/component.json +0 -18
- package/node_modules/request/node_modules/node-uuid/package.json +0 -54
- package/node_modules/request/node_modules/node-uuid/test/compare_v1.js +0 -63
- package/node_modules/request/node_modules/node-uuid/test/test.html +0 -17
- package/node_modules/request/node_modules/node-uuid/test/test.js +0 -228
- package/node_modules/request/node_modules/node-uuid/uuid.js +0 -245
- package/node_modules/request/node_modules/oauth-sign/LICENSE +0 -55
- package/node_modules/request/node_modules/oauth-sign/README.md +0 -4
- package/node_modules/request/node_modules/oauth-sign/index.js +0 -43
- package/node_modules/request/node_modules/oauth-sign/package.json +0 -49
- package/node_modules/request/node_modules/oauth-sign/test.js +0 -49
- package/node_modules/request/node_modules/qs/.jshintignore +0 -1
- package/node_modules/request/node_modules/qs/.jshintrc +0 -10
- package/node_modules/request/node_modules/qs/.npmignore +0 -18
- package/node_modules/request/node_modules/qs/.travis.yml +0 -4
- package/node_modules/request/node_modules/qs/LICENSE +0 -28
- package/node_modules/request/node_modules/qs/Makefile +0 -8
- package/node_modules/request/node_modules/qs/Readme.md +0 -120
- package/node_modules/request/node_modules/qs/index.js +0 -1
- package/node_modules/request/node_modules/qs/lib/index.js +0 -15
- package/node_modules/request/node_modules/qs/lib/parse.js +0 -151
- package/node_modules/request/node_modules/qs/lib/stringify.js +0 -52
- package/node_modules/request/node_modules/qs/lib/utils.js +0 -131
- package/node_modules/request/node_modules/qs/package.json +0 -61
- package/node_modules/request/node_modules/qs/test/parse.js +0 -236
- package/node_modules/request/node_modules/qs/test/stringify.js +0 -123
- package/node_modules/request/node_modules/stringstream/.npmignore +0 -15
- package/node_modules/request/node_modules/stringstream/.travis.yml +0 -4
- package/node_modules/request/node_modules/stringstream/LICENSE.txt +0 -4
- package/node_modules/request/node_modules/stringstream/README.md +0 -38
- package/node_modules/request/node_modules/stringstream/example.js +0 -27
- package/node_modules/request/node_modules/stringstream/package.json +0 -48
- package/node_modules/request/node_modules/stringstream/stringstream.js +0 -102
- package/node_modules/request/node_modules/tough-cookie/.jshintrc +0 -70
- package/node_modules/request/node_modules/tough-cookie/.npmignore +0 -3
- package/node_modules/request/node_modules/tough-cookie/.travis.yml +0 -8
- package/node_modules/request/node_modules/tough-cookie/LICENSE +0 -78
- package/node_modules/request/node_modules/tough-cookie/README.md +0 -412
- package/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js +0 -239
- package/node_modules/request/node_modules/tough-cookie/lib/cookie.js +0 -1107
- package/node_modules/request/node_modules/tough-cookie/lib/memstore.js +0 -123
- package/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js +0 -69
- package/node_modules/request/node_modules/tough-cookie/lib/store.js +0 -37
- package/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-MIT.txt +0 -20
- package/node_modules/request/node_modules/tough-cookie/node_modules/punycode/README.md +0 -176
- package/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json +0 -87
- package/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js +0 -528
- package/node_modules/request/node_modules/tough-cookie/package.json +0 -67
- package/node_modules/request/node_modules/tough-cookie/public-suffix.txt +0 -5229
- package/node_modules/request/node_modules/tough-cookie/test.js +0 -1625
- package/node_modules/request/node_modules/tunnel-agent/.jshintrc +0 -5
- package/node_modules/request/node_modules/tunnel-agent/LICENSE +0 -55
- package/node_modules/request/node_modules/tunnel-agent/README.md +0 -4
- package/node_modules/request/node_modules/tunnel-agent/index.js +0 -236
- package/node_modules/request/node_modules/tunnel-agent/package.json +0 -46
- package/node_modules/request/package.json +0 -77
- package/node_modules/request/request.js +0 -1428
- package/test/fixtures/github-response.json +0 -1367
- package/test/index.js +0 -55
@@ -1,31 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Test to verify that the offset is incremented when structures are written to.
|
3
|
-
* Hopefully we will not regress issue #41
|
4
|
-
*/
|
5
|
-
|
6
|
-
var mod_ctype = require('../../ctype.js');
|
7
|
-
var mod_assert = require('assert');
|
8
|
-
|
9
|
-
function test()
|
10
|
-
{
|
11
|
-
var parser, buf, data;
|
12
|
-
parser = new mod_ctype.Parser({
|
13
|
-
endian: 'little'
|
14
|
-
});
|
15
|
-
parser.typedef('point_t', [
|
16
|
-
{ x: { type: 'uint8_t' } },
|
17
|
-
{ y: { type: 'uint8_t' } }
|
18
|
-
]);
|
19
|
-
buf = new Buffer(4);
|
20
|
-
data = [
|
21
|
-
{ point1: { type: 'point_t' } },
|
22
|
-
{ point2: { type: 'point_t' } }
|
23
|
-
];
|
24
|
-
parser.writeData(data, buf, 0, [ [ 23, 42 ], [ 91, 18 ] ]);
|
25
|
-
mod_assert.ok(buf[0] == 23);
|
26
|
-
mod_assert.ok(buf[1] == 42);
|
27
|
-
mod_assert.ok(buf[2] == 91);
|
28
|
-
mod_assert.ok(buf[3] == 18);
|
29
|
-
}
|
30
|
-
|
31
|
-
test();
|
@@ -1,54 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"author": {
|
3
|
-
"name": "Joyent, Inc"
|
4
|
-
},
|
5
|
-
"name": "http-signature",
|
6
|
-
"description": "Reference implementation of Joyent's HTTP Signature Scheme",
|
7
|
-
"version": "0.10.0",
|
8
|
-
"repository": {
|
9
|
-
"type": "git",
|
10
|
-
"url": "git://github.com/joyent/node-http-signature.git"
|
11
|
-
},
|
12
|
-
"engines": {
|
13
|
-
"node": ">=0.8"
|
14
|
-
},
|
15
|
-
"main": "lib/index.js",
|
16
|
-
"scripts": {
|
17
|
-
"test": "tap tst/*.js"
|
18
|
-
},
|
19
|
-
"dependencies": {
|
20
|
-
"assert-plus": "0.1.2",
|
21
|
-
"asn1": "0.1.11",
|
22
|
-
"ctype": "0.5.2"
|
23
|
-
},
|
24
|
-
"devDependencies": {
|
25
|
-
"node-uuid": "1.4.0",
|
26
|
-
"tap": "0.4.2"
|
27
|
-
},
|
28
|
-
"readme": "# node-http-signature\n\nnode-http-signature is a node.js library that has client and server components\nfor Joyent's [HTTP Signature Scheme](http_signing.md).\n\n## Usage\n\nNote the example below signs a request with the same key/cert used to start an\nHTTP server. This is almost certainly not what you actaully want, but is just\nused to illustrate the API calls; you will need to provide your own key\nmanagement in addition to this library.\n\n### Client\n\n var fs = require('fs');\n var https = require('https');\n var httpSignature = require('http-signature');\n\n var key = fs.readFileSync('./key.pem', 'ascii');\n\n var options = {\n host: 'localhost',\n port: 8443,\n path: '/',\n method: 'GET',\n headers: {}\n };\n\n // Adds a 'Date' header in, signs it, and adds the\n // 'Authorization' header in.\n var req = https.request(options, function(res) {\n console.log(res.statusCode);\n });\n\n\n httpSignature.sign(req, {\n key: key,\n keyId: './cert.pem'\n });\n\n req.end();\n\n### Server\n\n var fs = require('fs');\n var https = require('https');\n var httpSignature = require('http-signature');\n\n var options = {\n key: fs.readFileSync('./key.pem'),\n cert: fs.readFileSync('./cert.pem')\n };\n\n https.createServer(options, function (req, res) {\n var rc = 200;\n var parsed = httpSignature.parseRequest(req);\n var pub = fs.readFileSync(parsed.keyId, 'ascii');\n if (!httpSignature.verifySignature(parsed, pub))\n rc = 401;\n\n res.writeHead(rc);\n res.end();\n }).listen(8443);\n\n## Installation\n\n npm install http-signature\n\n## License\n\nMIT.\n\n## Bugs\n\nSee <https://github.com/joyent/node-http-signature/issues>.\n",
|
29
|
-
"readmeFilename": "README.md",
|
30
|
-
"_id": "http-signature@0.10.0",
|
31
|
-
"dist": {
|
32
|
-
"shasum": "1494e4f5000a83c0f11bcc12d6007c530cb99582",
|
33
|
-
"tarball": "http://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz"
|
34
|
-
},
|
35
|
-
"_from": "http-signature@~0.10.0",
|
36
|
-
"_npmVersion": "1.2.18",
|
37
|
-
"_npmUser": {
|
38
|
-
"name": "mcavage",
|
39
|
-
"email": "mcavage@gmail.com"
|
40
|
-
},
|
41
|
-
"maintainers": [
|
42
|
-
{
|
43
|
-
"name": "mcavage",
|
44
|
-
"email": "mcavage@gmail.com"
|
45
|
-
}
|
46
|
-
],
|
47
|
-
"directories": {},
|
48
|
-
"_shasum": "1494e4f5000a83c0f11bcc12d6007c530cb99582",
|
49
|
-
"_resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz",
|
50
|
-
"bugs": {
|
51
|
-
"url": "https://github.com/joyent/node-http-signature/issues"
|
52
|
-
},
|
53
|
-
"homepage": "https://github.com/joyent/node-http-signature"
|
54
|
-
}
|
@@ -1,27 +0,0 @@
|
|
1
|
-
Copyright (c) Isaac Z. Schlueter ("Author")
|
2
|
-
All rights reserved.
|
3
|
-
|
4
|
-
The BSD License
|
5
|
-
|
6
|
-
Redistribution and use in source and binary forms, with or without
|
7
|
-
modification, are permitted provided that the following conditions
|
8
|
-
are met:
|
9
|
-
|
10
|
-
1. Redistributions of source code must retain the above copyright
|
11
|
-
notice, this list of conditions and the following disclaimer.
|
12
|
-
|
13
|
-
2. Redistributions in binary form must reproduce the above copyright
|
14
|
-
notice, this list of conditions and the following disclaimer in the
|
15
|
-
documentation and/or other materials provided with the distribution.
|
16
|
-
|
17
|
-
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
18
|
-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
19
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
20
|
-
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
|
21
|
-
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
22
|
-
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
23
|
-
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
24
|
-
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
25
|
-
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
26
|
-
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
27
|
-
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
@@ -1,49 +0,0 @@
|
|
1
|
-
# json-stringify-safe
|
2
|
-
|
3
|
-
Like JSON.stringify, but doesn't throw on circular references.
|
4
|
-
|
5
|
-
## Usage
|
6
|
-
|
7
|
-
Takes the same arguments as `JSON.stringify`.
|
8
|
-
|
9
|
-
```javascript
|
10
|
-
var stringify = require('json-stringify-safe');
|
11
|
-
var circularObj = {};
|
12
|
-
circularObj.circularRef = circularObj;
|
13
|
-
circularObj.list = [ circularObj, circularObj ];
|
14
|
-
console.log(stringify(circularObj, null, 2));
|
15
|
-
```
|
16
|
-
|
17
|
-
Output:
|
18
|
-
|
19
|
-
```json
|
20
|
-
{
|
21
|
-
"circularRef": "[Circular]",
|
22
|
-
"list": [
|
23
|
-
"[Circular]",
|
24
|
-
"[Circular]"
|
25
|
-
]
|
26
|
-
}
|
27
|
-
```
|
28
|
-
|
29
|
-
## Details
|
30
|
-
|
31
|
-
```
|
32
|
-
stringify(obj, serializer, indent, decycler)
|
33
|
-
```
|
34
|
-
|
35
|
-
The first three arguments are the same as to JSON.stringify. The last
|
36
|
-
is an argument that's only used when the object has been seen already.
|
37
|
-
|
38
|
-
The default `decycler` function returns the string `'[Circular]'`.
|
39
|
-
If, for example, you pass in `function(k,v){}` (return nothing) then it
|
40
|
-
will prune cycles. If you pass in `function(k,v){ return {foo: 'bar'}}`,
|
41
|
-
then cyclical objects will always be represented as `{"foo":"bar"}` in
|
42
|
-
the result.
|
43
|
-
|
44
|
-
```
|
45
|
-
stringify.getSerialize(serializer, decycler)
|
46
|
-
```
|
47
|
-
|
48
|
-
Returns a serializer that can be used elsewhere. This is the actual
|
49
|
-
function that's passed to JSON.stringify.
|
@@ -1,51 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "json-stringify-safe",
|
3
|
-
"version": "5.0.0",
|
4
|
-
"description": "Like JSON.stringify, but doesn't blow up on circular refs",
|
5
|
-
"main": "stringify.js",
|
6
|
-
"scripts": {
|
7
|
-
"test": "node test.js"
|
8
|
-
},
|
9
|
-
"repository": {
|
10
|
-
"type": "git",
|
11
|
-
"url": "git://github.com/isaacs/json-stringify-safe"
|
12
|
-
},
|
13
|
-
"keywords": [
|
14
|
-
"json",
|
15
|
-
"stringify",
|
16
|
-
"circular",
|
17
|
-
"safe"
|
18
|
-
],
|
19
|
-
"author": {
|
20
|
-
"name": "Isaac Z. Schlueter",
|
21
|
-
"email": "i@izs.me",
|
22
|
-
"url": "http://blog.izs.me"
|
23
|
-
},
|
24
|
-
"license": "BSD",
|
25
|
-
"readmeFilename": "README.md",
|
26
|
-
"readme": "# json-stringify-safe\n\nLike JSON.stringify, but doesn't throw on circular references.\n\n## Usage\n\nTakes the same arguments as `JSON.stringify`.\n\n```javascript\nvar stringify = require('json-stringify-safe');\nvar circularObj = {};\ncircularObj.circularRef = circularObj;\ncircularObj.list = [ circularObj, circularObj ];\nconsole.log(stringify(circularObj, null, 2));\n```\n\nOutput:\n\n```json\n{\n \"circularRef\": \"[Circular]\",\n \"list\": [\n \"[Circular]\",\n \"[Circular]\"\n ]\n}\n```\n\n## Details\n\n```\nstringify(obj, serializer, indent, decycler)\n```\n\nThe first three arguments are the same as to JSON.stringify. The last\nis an argument that's only used when the object has been seen already.\n\nThe default `decycler` function returns the string `'[Circular]'`.\nIf, for example, you pass in `function(k,v){}` (return nothing) then it\nwill prune cycles. If you pass in `function(k,v){ return {foo: 'bar'}}`,\nthen cyclical objects will always be represented as `{\"foo\":\"bar\"}` in\nthe result.\n\n```\nstringify.getSerialize(serializer, decycler)\n```\n\nReturns a serializer that can be used elsewhere. This is the actual\nfunction that's passed to JSON.stringify.\n",
|
27
|
-
"bugs": {
|
28
|
-
"url": "https://github.com/isaacs/json-stringify-safe/issues"
|
29
|
-
},
|
30
|
-
"_id": "json-stringify-safe@5.0.0",
|
31
|
-
"dist": {
|
32
|
-
"shasum": "4c1f228b5050837eba9d21f50c2e6e320624566e",
|
33
|
-
"tarball": "http://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz"
|
34
|
-
},
|
35
|
-
"_from": "json-stringify-safe@~5.0.0",
|
36
|
-
"_npmVersion": "1.3.6",
|
37
|
-
"_npmUser": {
|
38
|
-
"name": "isaacs",
|
39
|
-
"email": "i@izs.me"
|
40
|
-
},
|
41
|
-
"maintainers": [
|
42
|
-
{
|
43
|
-
"name": "isaacs",
|
44
|
-
"email": "i@izs.me"
|
45
|
-
}
|
46
|
-
],
|
47
|
-
"directories": {},
|
48
|
-
"_shasum": "4c1f228b5050837eba9d21f50c2e6e320624566e",
|
49
|
-
"_resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz",
|
50
|
-
"homepage": "https://github.com/isaacs/json-stringify-safe"
|
51
|
-
}
|
@@ -1,39 +0,0 @@
|
|
1
|
-
module.exports = stringify;
|
2
|
-
|
3
|
-
function getSerialize (fn, decycle) {
|
4
|
-
var seen = [], keys = [];
|
5
|
-
decycle = decycle || function(key, value) {
|
6
|
-
return '[Circular ' + getPath(value, seen, keys) + ']'
|
7
|
-
};
|
8
|
-
return function(key, value) {
|
9
|
-
var ret = value;
|
10
|
-
if (typeof value === 'object' && value) {
|
11
|
-
if (seen.indexOf(value) !== -1)
|
12
|
-
ret = decycle(key, value);
|
13
|
-
else {
|
14
|
-
seen.push(value);
|
15
|
-
keys.push(key);
|
16
|
-
}
|
17
|
-
}
|
18
|
-
if (fn) ret = fn(key, ret);
|
19
|
-
return ret;
|
20
|
-
}
|
21
|
-
}
|
22
|
-
|
23
|
-
function getPath (value, seen, keys) {
|
24
|
-
var index = seen.indexOf(value);
|
25
|
-
var path = [ keys[index] ];
|
26
|
-
for (index--; index >= 0; index--) {
|
27
|
-
if (seen[index][ path[0] ] === value) {
|
28
|
-
value = seen[index];
|
29
|
-
path.unshift(keys[index]);
|
30
|
-
}
|
31
|
-
}
|
32
|
-
return '~' + path.join('.');
|
33
|
-
}
|
34
|
-
|
35
|
-
function stringify(obj, fn, spaces, decycle) {
|
36
|
-
return JSON.stringify(obj, getSerialize(fn, decycle), spaces);
|
37
|
-
}
|
38
|
-
|
39
|
-
stringify.getSerialize = getSerialize;
|
@@ -1,128 +0,0 @@
|
|
1
|
-
var stringify = require('./stringify.js');
|
2
|
-
|
3
|
-
var circularObj = { a: 'b' };
|
4
|
-
circularObj.circularRef = circularObj;
|
5
|
-
circularObj.list = [ circularObj, circularObj ];
|
6
|
-
|
7
|
-
//////////
|
8
|
-
// default
|
9
|
-
var testObj = {
|
10
|
-
"a": "b",
|
11
|
-
"circularRef": "[Circular ~]",
|
12
|
-
"list": [
|
13
|
-
"[Circular ~]",
|
14
|
-
"[Circular ~]"
|
15
|
-
]
|
16
|
-
};
|
17
|
-
|
18
|
-
var assert = require('assert');
|
19
|
-
assert.equal(JSON.stringify(testObj, null, 2),
|
20
|
-
stringify(circularObj, null, 2));
|
21
|
-
|
22
|
-
assert.equal(JSON.stringify(testObj, null, 2),
|
23
|
-
JSON.stringify(circularObj, stringify.getSerialize(), 2));
|
24
|
-
|
25
|
-
|
26
|
-
////////
|
27
|
-
// prune
|
28
|
-
testObj = {
|
29
|
-
"a": "b",
|
30
|
-
"list": [
|
31
|
-
null,
|
32
|
-
null
|
33
|
-
]
|
34
|
-
};
|
35
|
-
|
36
|
-
function prune(k, v) {}
|
37
|
-
|
38
|
-
assert.equal(JSON.stringify(testObj, null, 2),
|
39
|
-
stringify(circularObj, null, 2, prune));
|
40
|
-
|
41
|
-
///////////
|
42
|
-
// re-cycle
|
43
|
-
// (throws)
|
44
|
-
function recycle(k, v) {
|
45
|
-
return v;
|
46
|
-
}
|
47
|
-
|
48
|
-
assert.throws(function() {
|
49
|
-
stringify(circularObj, null, 2, recycle);
|
50
|
-
});
|
51
|
-
|
52
|
-
////////
|
53
|
-
// fancy
|
54
|
-
testObj = {
|
55
|
-
"a": "b",
|
56
|
-
"circularRef": "circularRef{a:string,circularRef:Object,list:Array}",
|
57
|
-
"list": [
|
58
|
-
"0{a:string,circularRef:Object,list:Array}",
|
59
|
-
"1{a:string,circularRef:Object,list:Array}"
|
60
|
-
]
|
61
|
-
};
|
62
|
-
|
63
|
-
function signer(key, value) {
|
64
|
-
var ret = key + '{';
|
65
|
-
var f = false;
|
66
|
-
for (var i in value) {
|
67
|
-
if (f)
|
68
|
-
ret += ',';
|
69
|
-
f = true;
|
70
|
-
ret += i + ':';
|
71
|
-
var v = value[i];
|
72
|
-
switch (typeof v) {
|
73
|
-
case 'object':
|
74
|
-
if (!v)
|
75
|
-
ret += 'null';
|
76
|
-
else if (Array.isArray(v))
|
77
|
-
ret += 'Array'
|
78
|
-
else
|
79
|
-
ret += v.constructor && v.constructor.name || 'Object';
|
80
|
-
break;
|
81
|
-
default:
|
82
|
-
ret += typeof v;
|
83
|
-
break;
|
84
|
-
}
|
85
|
-
}
|
86
|
-
ret += '}';
|
87
|
-
return ret;
|
88
|
-
}
|
89
|
-
|
90
|
-
assert.equal(JSON.stringify(testObj, null, 2),
|
91
|
-
stringify(circularObj, null, 2, signer));
|
92
|
-
|
93
|
-
|
94
|
-
///////
|
95
|
-
//multi
|
96
|
-
var a = { x: 1 };
|
97
|
-
a.a = a;
|
98
|
-
var b = { x: 2 };
|
99
|
-
b.a = a;
|
100
|
-
|
101
|
-
var c = { a: a, b: b };
|
102
|
-
var d = { list: [ a, b, c ] };
|
103
|
-
d.d = d;
|
104
|
-
|
105
|
-
var multi = {
|
106
|
-
"list": [
|
107
|
-
{
|
108
|
-
"x": 1,
|
109
|
-
"a": "[Circular ~.list.0]"
|
110
|
-
},
|
111
|
-
{
|
112
|
-
"x": 2,
|
113
|
-
"a": "[Circular ~.list.0]"
|
114
|
-
},
|
115
|
-
{
|
116
|
-
"a": "[Circular ~.list.0]",
|
117
|
-
"b": "[Circular ~.list.1]"
|
118
|
-
}
|
119
|
-
],
|
120
|
-
"d": "[Circular ~]"
|
121
|
-
};
|
122
|
-
|
123
|
-
assert.equal(JSON.stringify(multi, null, 2),
|
124
|
-
stringify(d, null, 2));
|
125
|
-
|
126
|
-
////////
|
127
|
-
// pass!
|
128
|
-
console.log('ok');
|
@@ -1,12 +0,0 @@
|
|
1
|
-
language: node_js
|
2
|
-
node_js:
|
3
|
-
- "0.8"
|
4
|
-
- "0.10"
|
5
|
-
- "0.11"
|
6
|
-
matrix:
|
7
|
-
allow_failures:
|
8
|
-
- node_js: "0.11"
|
9
|
-
fast_finish: true
|
10
|
-
before_install:
|
11
|
-
# remove build script deps before install
|
12
|
-
- node -pe 'f="./package.json";p=require(f);d=p.devDependencies;for(k in d){if("co"===k.substr(0,2))delete d[k]}require("fs").writeFileSync(f,JSON.stringify(p,null,2))'
|
@@ -1,22 +0,0 @@
|
|
1
|
-
|
2
|
-
The MIT License (MIT)
|
3
|
-
|
4
|
-
Copyright (c) 2014 Jonathan Ong me@jongleberry.com
|
5
|
-
|
6
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
-
of this software and associated documentation files (the "Software"), to deal
|
8
|
-
in the Software without restriction, including without limitation the rights
|
9
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
-
copies of the Software, and to permit persons to whom the Software is
|
11
|
-
furnished to do so, subject to the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be included in
|
14
|
-
all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
-
THE SOFTWARE.
|
@@ -1,101 +0,0 @@
|
|
1
|
-
# mime-types
|
2
|
-
[](https://badge.fury.io/js/mime-types) [](https://travis-ci.org/expressjs/mime-types)
|
3
|
-
|
4
|
-
The ultimate javascript content-type utility.
|
5
|
-
|
6
|
-
### Install
|
7
|
-
|
8
|
-
```sh
|
9
|
-
$ npm install mime-types
|
10
|
-
```
|
11
|
-
|
12
|
-
#### Similar to [node-mime](https://github.com/broofa/node-mime), except:
|
13
|
-
|
14
|
-
- __No fallbacks.__ Instead of naively returning the first available type, `mime-types` simply returns `false`, so do `var type = mime.lookup('unrecognized') || 'application/octet-stream'`.
|
15
|
-
- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`.
|
16
|
-
- Additional mime types are added such as jade and stylus. Feel free to add more!
|
17
|
-
- Browser support via Browserify and Component by converting lists to JSON files.
|
18
|
-
|
19
|
-
Otherwise, the API is compatible.
|
20
|
-
|
21
|
-
### Adding Types
|
22
|
-
|
23
|
-
If you'd like to add additional types,
|
24
|
-
simply create a PR adding the type to `custom.json` and
|
25
|
-
a reference link to the [sources](SOURCES.md).
|
26
|
-
|
27
|
-
Do __NOT__ edit `mime.json` or `node.json`.
|
28
|
-
Those are pulled using `build.js`.
|
29
|
-
You should only touch `custom.json`.
|
30
|
-
|
31
|
-
## API
|
32
|
-
|
33
|
-
```js
|
34
|
-
var mime = require('mime-types')
|
35
|
-
```
|
36
|
-
|
37
|
-
All functions return `false` if input is invalid or not found.
|
38
|
-
|
39
|
-
### mime.lookup(path)
|
40
|
-
|
41
|
-
Lookup the content-type associated with a file.
|
42
|
-
|
43
|
-
```js
|
44
|
-
mime.lookup('json') // 'application/json'
|
45
|
-
mime.lookup('.md') // 'text/x-markdown'
|
46
|
-
mime.lookup('file.html') // 'text/html'
|
47
|
-
mime.lookup('folder/file.js') // 'application/javascript'
|
48
|
-
|
49
|
-
mime.lookup('cats') // false
|
50
|
-
```
|
51
|
-
|
52
|
-
### mime.contentType(type)
|
53
|
-
|
54
|
-
Create a full content-type header given a content-type or extension.
|
55
|
-
|
56
|
-
```js
|
57
|
-
mime.contentType('markdown') // 'text/x-markdown; charset=utf-8'
|
58
|
-
mime.contentType('file.json') // 'application/json; charset=utf-8'
|
59
|
-
```
|
60
|
-
|
61
|
-
### mime.extension(type)
|
62
|
-
|
63
|
-
Get the default extension for a content-type.
|
64
|
-
|
65
|
-
```js
|
66
|
-
mime.extension('application/octet-stream') // 'bin'
|
67
|
-
```
|
68
|
-
|
69
|
-
### mime.charset(type)
|
70
|
-
|
71
|
-
Lookup the implied default charset of a content-type.
|
72
|
-
|
73
|
-
```js
|
74
|
-
mime.charset('text/x-markdown') // 'UTF-8'
|
75
|
-
```
|
76
|
-
|
77
|
-
### mime.types[extension] = type
|
78
|
-
|
79
|
-
A map of content-types by extension.
|
80
|
-
|
81
|
-
### mime.extensions[type] = [extensions]
|
82
|
-
|
83
|
-
A map of extensions by content-type.
|
84
|
-
|
85
|
-
### mime.define(types)
|
86
|
-
|
87
|
-
Globally add definitions.
|
88
|
-
`types` must be an object of the form:
|
89
|
-
|
90
|
-
```js
|
91
|
-
{
|
92
|
-
"<content-type>": [extensions...],
|
93
|
-
"<content-type>": [extensions...]
|
94
|
-
}
|
95
|
-
```
|
96
|
-
|
97
|
-
See the `.json` files in `lib/` for examples.
|
98
|
-
|
99
|
-
## License
|
100
|
-
|
101
|
-
[MIT](LICENSE)
|
@@ -1,17 +0,0 @@
|
|
1
|
-
|
2
|
-
### Sources for custom types
|
3
|
-
|
4
|
-
This is a list of sources for any custom mime types.
|
5
|
-
When adding custom mime types, please link to where you found the mime type,
|
6
|
-
even if it's from an unofficial source.
|
7
|
-
|
8
|
-
- `text/coffeescript` - http://coffeescript.org/#scripts
|
9
|
-
- `text/x-handlebars-template` - https://handlebarsjs.com/#getting-started
|
10
|
-
- `text/x-sass` & `text/x-scss` - https://github.com/janlelis/rubybuntu-mime/blob/master/sass.xml
|
11
|
-
- `text.jsx` - http://facebook.github.io/react/docs/getting-started.html [[2]](https://github.com/facebook/react/blob/f230e0a03154e6f8a616e0da1fb3d97ffa1a6472/vendor/browser-transforms.js#L210)
|
12
|
-
|
13
|
-
[Sources for node.json types](https://github.com/broofa/node-mime/blob/master/types/node.types)
|
14
|
-
|
15
|
-
### Notes on weird types
|
16
|
-
|
17
|
-
- `font/opentype` - This type is technically invalid according to the spec. No valid types begin with `font/`. No-one uses the official type of `application/vnd.ms-opentype` as the community standardized `application/x-font-otf`. However, chrome logs nonsense warnings unless opentype fonts are served with `font/opentype`. [[1]](http://stackoverflow.com/questions/2871655/proper-mime-type-for-fonts)
|
@@ -1,16 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "mime-types",
|
3
|
-
"description": "The ultimate javascript content-type utility.",
|
4
|
-
"version": "0.1.0",
|
5
|
-
"author": {
|
6
|
-
"name": "Jonathan Ong",
|
7
|
-
"email": "me@jongleberry.com",
|
8
|
-
"url": "http://jongleberry.com",
|
9
|
-
"twitter": "https://twitter.com/jongleberry"
|
10
|
-
},
|
11
|
-
"repository": "expressjs/mime-types",
|
12
|
-
"license": "MIT",
|
13
|
-
"main": "lib/index.js",
|
14
|
-
"scripts": ["lib/index.js"],
|
15
|
-
"json": ["mime.json", "node.json", "custom.json"]
|
16
|
-
}
|
@@ -1,27 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"text/jade": [
|
3
|
-
"jade"
|
4
|
-
],
|
5
|
-
"text/stylus": [
|
6
|
-
"stylus",
|
7
|
-
"styl"
|
8
|
-
],
|
9
|
-
"text/less": [
|
10
|
-
"less"
|
11
|
-
],
|
12
|
-
"text/x-sass": [
|
13
|
-
"sass"
|
14
|
-
],
|
15
|
-
"text/x-scss": [
|
16
|
-
"scss"
|
17
|
-
],
|
18
|
-
"text/coffeescript": [
|
19
|
-
"coffee"
|
20
|
-
],
|
21
|
-
"text/x-handlebars-template": [
|
22
|
-
"hbs"
|
23
|
-
],
|
24
|
-
"text/jsx": [
|
25
|
-
"jsx"
|
26
|
-
]
|
27
|
-
}
|