├── .github └── FUNDING.yml ├── LICENSE.md ├── README.md ├── build.sh ├── constants.json ├── package.json ├── tea.yaml └── test.js /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | tidelift: "npm/constants-browserify" 2 | patreon: juliangruber 3 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Julian Gruber 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # constants-browserify 3 | 4 | Node's `constants` module for the browser. 5 | 6 | [![downloads](https://img.shields.io/npm/dm/constants-browserify.svg)](https://www.npmjs.org/package/constants-browserify) 7 | 8 | ## Usage 9 | 10 | To use with browserify cli: 11 | 12 | ```bash 13 | $ browserify -r constants:constants-browserify script.js 14 | ``` 15 | 16 | To use with browserify api: 17 | 18 | ```js 19 | browserify() 20 | .require('constants-browserify', { expose: 'constants' }) 21 | .add(__dirname + '/script.js') 22 | .bundle() 23 | // ... 24 | ``` 25 | 26 | ## Installation 27 | 28 | With [npm](http://npmjs.org) do 29 | 30 | ```bash 31 | $ npm install constants-browserify 32 | ``` 33 | 34 | ## Security contact information 35 | 36 | To report a security vulnerability, please use the 37 | [Tidelift security contact](https://tidelift.com/security). 38 | Tidelift will coordinate the fix and disclosure. 39 | 40 | ## License 41 | 42 | Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> 43 | 44 | Permission is hereby granted, free of charge, to any person obtaining a copy 45 | of this software and associated documentation files (the "Software"), to deal 46 | in the Software without restriction, including without limitation the rights 47 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 48 | copies of the Software, and to permit persons to whom the Software is 49 | furnished to do so, subject to the following conditions: 50 | 51 | The above copyright notice and this permission notice shall be included in 52 | all copies or substantial portions of the Software. 53 | 54 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 55 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 56 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 57 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 58 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 59 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 60 | THE SOFTWARE. 61 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | node -pe 'JSON.stringify(require("constants"), null, " ")' > constants.json 2 | -------------------------------------------------------------------------------- /constants.json: -------------------------------------------------------------------------------- 1 | { 2 | "O_RDONLY": 0, 3 | "O_WRONLY": 1, 4 | "O_RDWR": 2, 5 | "S_IFMT": 61440, 6 | "S_IFREG": 32768, 7 | "S_IFDIR": 16384, 8 | "S_IFCHR": 8192, 9 | "S_IFBLK": 24576, 10 | "S_IFIFO": 4096, 11 | "S_IFLNK": 40960, 12 | "S_IFSOCK": 49152, 13 | "O_CREAT": 512, 14 | "O_EXCL": 2048, 15 | "O_NOCTTY": 131072, 16 | "O_TRUNC": 1024, 17 | "O_APPEND": 8, 18 | "O_DIRECTORY": 1048576, 19 | "O_NOFOLLOW": 256, 20 | "O_SYNC": 128, 21 | "O_SYMLINK": 2097152, 22 | "O_NONBLOCK": 4, 23 | "S_IRWXU": 448, 24 | "S_IRUSR": 256, 25 | "S_IWUSR": 128, 26 | "S_IXUSR": 64, 27 | "S_IRWXG": 56, 28 | "S_IRGRP": 32, 29 | "S_IWGRP": 16, 30 | "S_IXGRP": 8, 31 | "S_IRWXO": 7, 32 | "S_IROTH": 4, 33 | "S_IWOTH": 2, 34 | "S_IXOTH": 1, 35 | "E2BIG": 7, 36 | "EACCES": 13, 37 | "EADDRINUSE": 48, 38 | "EADDRNOTAVAIL": 49, 39 | "EAFNOSUPPORT": 47, 40 | "EAGAIN": 35, 41 | "EALREADY": 37, 42 | "EBADF": 9, 43 | "EBADMSG": 94, 44 | "EBUSY": 16, 45 | "ECANCELED": 89, 46 | "ECHILD": 10, 47 | "ECONNABORTED": 53, 48 | "ECONNREFUSED": 61, 49 | "ECONNRESET": 54, 50 | "EDEADLK": 11, 51 | "EDESTADDRREQ": 39, 52 | "EDOM": 33, 53 | "EDQUOT": 69, 54 | "EEXIST": 17, 55 | "EFAULT": 14, 56 | "EFBIG": 27, 57 | "EHOSTUNREACH": 65, 58 | "EIDRM": 90, 59 | "EILSEQ": 92, 60 | "EINPROGRESS": 36, 61 | "EINTR": 4, 62 | "EINVAL": 22, 63 | "EIO": 5, 64 | "EISCONN": 56, 65 | "EISDIR": 21, 66 | "ELOOP": 62, 67 | "EMFILE": 24, 68 | "EMLINK": 31, 69 | "EMSGSIZE": 40, 70 | "EMULTIHOP": 95, 71 | "ENAMETOOLONG": 63, 72 | "ENETDOWN": 50, 73 | "ENETRESET": 52, 74 | "ENETUNREACH": 51, 75 | "ENFILE": 23, 76 | "ENOBUFS": 55, 77 | "ENODATA": 96, 78 | "ENODEV": 19, 79 | "ENOENT": 2, 80 | "ENOEXEC": 8, 81 | "ENOLCK": 77, 82 | "ENOLINK": 97, 83 | "ENOMEM": 12, 84 | "ENOMSG": 91, 85 | "ENOPROTOOPT": 42, 86 | "ENOSPC": 28, 87 | "ENOSR": 98, 88 | "ENOSTR": 99, 89 | "ENOSYS": 78, 90 | "ENOTCONN": 57, 91 | "ENOTDIR": 20, 92 | "ENOTEMPTY": 66, 93 | "ENOTSOCK": 38, 94 | "ENOTSUP": 45, 95 | "ENOTTY": 25, 96 | "ENXIO": 6, 97 | "EOPNOTSUPP": 102, 98 | "EOVERFLOW": 84, 99 | "EPERM": 1, 100 | "EPIPE": 32, 101 | "EPROTO": 100, 102 | "EPROTONOSUPPORT": 43, 103 | "EPROTOTYPE": 41, 104 | "ERANGE": 34, 105 | "EROFS": 30, 106 | "ESPIPE": 29, 107 | "ESRCH": 3, 108 | "ESTALE": 70, 109 | "ETIME": 101, 110 | "ETIMEDOUT": 60, 111 | "ETXTBSY": 26, 112 | "EWOULDBLOCK": 35, 113 | "EXDEV": 18, 114 | "SIGHUP": 1, 115 | "SIGINT": 2, 116 | "SIGQUIT": 3, 117 | "SIGILL": 4, 118 | "SIGTRAP": 5, 119 | "SIGABRT": 6, 120 | "SIGIOT": 6, 121 | "SIGBUS": 10, 122 | "SIGFPE": 8, 123 | "SIGKILL": 9, 124 | "SIGUSR1": 30, 125 | "SIGSEGV": 11, 126 | "SIGUSR2": 31, 127 | "SIGPIPE": 13, 128 | "SIGALRM": 14, 129 | "SIGTERM": 15, 130 | "SIGCHLD": 20, 131 | "SIGCONT": 19, 132 | "SIGSTOP": 17, 133 | "SIGTSTP": 18, 134 | "SIGTTIN": 21, 135 | "SIGTTOU": 22, 136 | "SIGURG": 16, 137 | "SIGXCPU": 24, 138 | "SIGXFSZ": 25, 139 | "SIGVTALRM": 26, 140 | "SIGPROF": 27, 141 | "SIGWINCH": 28, 142 | "SIGIO": 23, 143 | "SIGSYS": 12, 144 | "SSL_OP_ALL": 2147486719, 145 | "SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION": 262144, 146 | "SSL_OP_CIPHER_SERVER_PREFERENCE": 4194304, 147 | "SSL_OP_CISCO_ANYCONNECT": 32768, 148 | "SSL_OP_COOKIE_EXCHANGE": 8192, 149 | "SSL_OP_CRYPTOPRO_TLSEXT_BUG": 2147483648, 150 | "SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS": 2048, 151 | "SSL_OP_EPHEMERAL_RSA": 0, 152 | "SSL_OP_LEGACY_SERVER_CONNECT": 4, 153 | "SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER": 32, 154 | "SSL_OP_MICROSOFT_SESS_ID_BUG": 1, 155 | "SSL_OP_MSIE_SSLV2_RSA_PADDING": 0, 156 | "SSL_OP_NETSCAPE_CA_DN_BUG": 536870912, 157 | "SSL_OP_NETSCAPE_CHALLENGE_BUG": 2, 158 | "SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG": 1073741824, 159 | "SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG": 8, 160 | "SSL_OP_NO_COMPRESSION": 131072, 161 | "SSL_OP_NO_QUERY_MTU": 4096, 162 | "SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION": 65536, 163 | "SSL_OP_NO_SSLv2": 16777216, 164 | "SSL_OP_NO_SSLv3": 33554432, 165 | "SSL_OP_NO_TICKET": 16384, 166 | "SSL_OP_NO_TLSv1": 67108864, 167 | "SSL_OP_NO_TLSv1_1": 268435456, 168 | "SSL_OP_NO_TLSv1_2": 134217728, 169 | "SSL_OP_PKCS1_CHECK_1": 0, 170 | "SSL_OP_PKCS1_CHECK_2": 0, 171 | "SSL_OP_SINGLE_DH_USE": 1048576, 172 | "SSL_OP_SINGLE_ECDH_USE": 524288, 173 | "SSL_OP_SSLEAY_080_CLIENT_DH_BUG": 128, 174 | "SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG": 0, 175 | "SSL_OP_TLS_BLOCK_PADDING_BUG": 512, 176 | "SSL_OP_TLS_D5_BUG": 256, 177 | "SSL_OP_TLS_ROLLBACK_BUG": 8388608, 178 | "ENGINE_METHOD_DSA": 2, 179 | "ENGINE_METHOD_DH": 4, 180 | "ENGINE_METHOD_RAND": 8, 181 | "ENGINE_METHOD_ECDH": 16, 182 | "ENGINE_METHOD_ECDSA": 32, 183 | "ENGINE_METHOD_CIPHERS": 64, 184 | "ENGINE_METHOD_DIGESTS": 128, 185 | "ENGINE_METHOD_STORE": 256, 186 | "ENGINE_METHOD_PKEY_METHS": 512, 187 | "ENGINE_METHOD_PKEY_ASN1_METHS": 1024, 188 | "ENGINE_METHOD_ALL": 65535, 189 | "ENGINE_METHOD_NONE": 0, 190 | "DH_CHECK_P_NOT_SAFE_PRIME": 2, 191 | "DH_CHECK_P_NOT_PRIME": 1, 192 | "DH_UNABLE_TO_CHECK_GENERATOR": 4, 193 | "DH_NOT_SUITABLE_GENERATOR": 8, 194 | "NPN_ENABLED": 1, 195 | "RSA_PKCS1_PADDING": 1, 196 | "RSA_SSLV23_PADDING": 2, 197 | "RSA_NO_PADDING": 3, 198 | "RSA_PKCS1_OAEP_PADDING": 4, 199 | "RSA_X931_PADDING": 5, 200 | "RSA_PKCS1_PSS_PADDING": 6, 201 | "POINT_CONVERSION_COMPRESSED": 2, 202 | "POINT_CONVERSION_UNCOMPRESSED": 4, 203 | "POINT_CONVERSION_HYBRID": 6, 204 | "F_OK": 0, 205 | "R_OK": 4, 206 | "W_OK": 2, 207 | "X_OK": 1, 208 | "UV_UDP_REUSEADDR": 4 209 | } 210 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "constants-browserify", 3 | "description": "node's constants module for the browser", 4 | "version": "1.0.0", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/juliangruber/constants-browserify.git" 8 | }, 9 | "homepage": "https://github.com/juliangruber/constants-browserify", 10 | "main": "constants.json", 11 | "dependencies": {}, 12 | "keywords": [ 13 | "constants", 14 | "node", 15 | "browser", 16 | "browserify" 17 | ], 18 | "author": { 19 | "name": "Julian Gruber", 20 | "email": "julian@juliangruber.com", 21 | "url": "http://juliangruber.com" 22 | }, 23 | "scripts": { 24 | "test": "node test.js" 25 | }, 26 | "contributors": [ 27 | { 28 | "name": "James J. Womack", 29 | "email": "james@womack.io", 30 | "url": "http://netflix.com" 31 | } 32 | ], 33 | "license": "MIT" 34 | } 35 | -------------------------------------------------------------------------------- /tea.yaml: -------------------------------------------------------------------------------- 1 | # https://tea.xyz/what-is-this-file 2 | # 3 | # DO NOT REMOVE OR EDIT THIS WARNING: 4 | # 5 | # This file is auto-generated by the TEA app. It is intended to validate ownership of your repository. 6 | # DO NOT commit this file or accept any PR if you don't know what this is. 7 | # We are aware that spammers will try to use this file to try to profit off others' work. 8 | # We take this very seriously and will take action against any malicious actors. 9 | # 10 | # If you are not the owner of this repository, and someone maliciously opens a commit with this file 11 | # please report it to us at support@tea.xyz. 12 | # 13 | # A constitution without this header is invalid. 14 | --- 15 | version: 2.0.0 16 | codeOwners: 17 | - '0x50b4EC9Ec70BA2Ea1b95eC9EB0C64b46f13595f7' 18 | quorum: 1 19 | -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Assert = require('assert') 4 | var Constants = require('./') 5 | 6 | try { 7 | var nodeConstants = require('constants') 8 | 9 | Assert.deepEqual(nodeConstants, Constants, 'The constants file was not equal') 10 | } 11 | 12 | catch (e) { 13 | console.error(e) 14 | console.error('\nTests failed!') 15 | process.exit(1) 16 | } 17 | 18 | console.info('Tests passed!') 19 | --------------------------------------------------------------------------------