├── .editorconfig ├── .github ├── FUNDING.yml ├── dependabot.yml └── workflows │ └── bevry.yml ├── .gitignore ├── .npmignore ├── .prettierignore ├── CONTRIBUTING.md ├── HISTORY.md ├── LICENSE.md ├── README.md ├── SECURITY.md ├── bin.cjs ├── coffeelint.json ├── package-lock.json ├── package.json ├── source ├── bin.coffee ├── index.coffee └── test.coffee └── test-fixtures ├── api ├── cs-parse.coffee ├── cs-require.coffee ├── cson-parse.cson ├── js-parse.js ├── js-require.js └── json-parse.json ├── out-expected ├── 1.cson ├── 1.json ├── 2.cson ├── 2.json ├── 3.cson ├── 3.json ├── 4.cson ├── 4.json ├── 5.cson ├── 5.json ├── 6.cson ├── 6.json ├── 7.cson ├── 7.json ├── 8.cson └── 8.json └── src ├── 1.cson ├── 2.cson ├── 3.cson ├── 4.json ├── 5.coffee ├── 6.js ├── 7.coffee └── 8.cson /.editorconfig: -------------------------------------------------------------------------------- 1 | # 2023 June 22 2 | # https://github.com/bevry/base 3 | 4 | root = true 5 | 6 | [*] 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = false 11 | indent_style = tab 12 | 13 | [{*.mk,*.py}] 14 | indent_style = tab 15 | indent_size = 4 16 | 17 | [*.md] 18 | indent_style = space 19 | indent_size = 4 20 | 21 | [{*.json,*.lsrules,*.yaml,*.yml,*.bowerrc,*.babelrc,*.code-workspace}] 22 | indent_style = space 23 | indent_size = 2 24 | 25 | [{*.json,*.lsrules}] 26 | insert_final_newline = true 27 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [balupton] 2 | patreon: bevry 3 | open_collective: bevry 4 | ko_fi: balupton 5 | liberapay: bevry 6 | tidelift: npm/cson 7 | custom: ['https://bevry.me/fund'] -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: github-actions 4 | directory: / 5 | schedule: 6 | interval: weekly 7 | day: sunday 8 | time: '00:00' 9 | timezone: Australia/Perth 10 | - package-ecosystem: npm 11 | directory: / 12 | schedule: 13 | interval: weekly 14 | day: sunday 15 | time: '00:00' 16 | timezone: Australia/Perth 17 | open-pull-requests-limit: 0 18 | -------------------------------------------------------------------------------- /.github/workflows/bevry.yml: -------------------------------------------------------------------------------- 1 | name: bevry 2 | 'on': 3 | - push 4 | - pull_request 5 | jobs: 6 | test: 7 | strategy: 8 | matrix: 9 | os: 10 | - ubuntu-latest 11 | - macos-latest 12 | - windows-latest 13 | node: 14 | - '16' 15 | - '18' 16 | - '20' 17 | - '21' 18 | runs-on: ${{ matrix.os }} 19 | continue-on-error: ${{ contains('macos-latest windows-latest', matrix.os) }} 20 | steps: 21 | - uses: actions/checkout@v4 22 | - name: Install desired Node.js version 23 | uses: actions/setup-node@v4 24 | with: 25 | node-version: '20' 26 | - name: Verify Node.js Versions 27 | run: >- 28 | printf '%s' 'node: ' && node --version && printf '%s' 'npm: ' && npm 29 | --version && node -e 'console.log(process.versions)' 30 | - run: npm run our:setup 31 | - run: npm run our:compile 32 | - run: npm run our:verify 33 | - name: Install targeted Node.js 34 | if: ${{ matrix.node != 20 }} 35 | uses: actions/setup-node@v4 36 | with: 37 | node-version: ${{ matrix.node }} 38 | - name: Verify Node.js Versions 39 | run: >- 40 | printf '%s' 'node: ' && node --version && printf '%s' 'npm: ' && npm 41 | --version && node -e 'console.log(process.versions)' 42 | - run: npm test 43 | publish: 44 | if: ${{ github.event_name == 'push' }} 45 | needs: test 46 | runs-on: ubuntu-latest 47 | steps: 48 | - uses: actions/checkout@v4 49 | - name: Install desired Node.js version 50 | uses: actions/setup-node@v4 51 | with: 52 | node-version: '20' 53 | - name: Verify Node.js Versions 54 | run: >- 55 | printf '%s' 'node: ' && node --version && printf '%s' 'npm: ' && npm 56 | --version && node -e 'console.log(process.versions)' 57 | - run: npm run our:setup 58 | - run: npm run our:compile 59 | - run: npm run our:meta 60 | - name: publish to npm 61 | uses: bevry-actions/npm@v1.1.7 62 | with: 63 | npmAuthToken: ${{ secrets.NPM_AUTH_TOKEN }} 64 | npmBranchTag: ':next' 65 | automerge: 66 | permissions: 67 | contents: write 68 | pull-requests: write 69 | runs-on: ubuntu-latest 70 | if: github.actor == 'dependabot[bot]' 71 | steps: 72 | - name: Enable auto-merge for Dependabot PRs 73 | run: gh pr merge --auto --squash "$PR_URL" 74 | env: 75 | PR_URL: ${{github.event.pull_request.html_url}} 76 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} 77 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # 2020 June 3 2 | # https://github.com/bevry/base 3 | 4 | # System Files 5 | **/.DS_Store 6 | 7 | # Temp Files 8 | **/.docpad.db 9 | **/*.log 10 | **/*.cpuprofile 11 | **/*.heapsnapshot 12 | 13 | # Editor Files 14 | .c9/ 15 | .vscode/ 16 | 17 | # Yarn Files 18 | .yarn/* 19 | !.yarn/releases 20 | !.yarn/plugins 21 | !.yarn/sdks 22 | !.yarn/versions 23 | .pnp.* 24 | .pnp/ 25 | 26 | # Private Files 27 | .env 28 | .idea 29 | .cake_task_cache 30 | 31 | # Build Caches 32 | build/ 33 | bower_components/ 34 | node_modules/ 35 | .next/ 36 | 37 | # ------------------------------------- 38 | # CDN Inclusions, Git Exclusions 39 | 40 | # Build Outputs 41 | **/out.* 42 | **/*.out.* 43 | **/out/ 44 | **/output/ 45 | *compiled* 46 | edition*/ 47 | coffeejs/ 48 | coffee/ 49 | es5/ 50 | es2015/ 51 | esnext/ 52 | docs/ 53 | 54 | # ===================================== 55 | # CUSTOM 56 | 57 | # None 58 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # 2020 May 5 2 | # https://github.com/bevry/base 3 | 4 | # System Files 5 | **/.DS_Store 6 | 7 | # Temp Files 8 | **/.docpad.db 9 | **/*.log 10 | **/*.cpuprofile 11 | **/*.heapsnapshot 12 | 13 | # Editor Files 14 | .c9/ 15 | .vscode/ 16 | 17 | # Private Files 18 | .env 19 | .idea 20 | .cake_task_cache 21 | 22 | # Build Caches 23 | build/ 24 | components/ 25 | bower_components/ 26 | node_modules/ 27 | .pnp/ 28 | .pnp.js 29 | 30 | # Ecosystem Files 31 | .dependabout 32 | .github 33 | 34 | # ------------------------------------- 35 | # CDN Inclusions, Package Exclusions 36 | 37 | # Documentation Files 38 | docs/ 39 | guides/ 40 | BACKERS.md 41 | CONTRIBUTING.md 42 | HISTORY.md 43 | 44 | # Development Files 45 | web/ 46 | **/example* 47 | **/test* 48 | .babelrc* 49 | .editorconfig 50 | .eslintrc* 51 | .jshintrc 52 | .jscrc 53 | coffeelint* 54 | .travis* 55 | nakefile* 56 | Cakefile 57 | Makefile 58 | 59 | # Other Package Definitions 60 | template.js 61 | component.json 62 | bower.json 63 | 64 | # ===================================== 65 | # CUSTOM MODIFICATIONS 66 | 67 | # None 68 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # 2023 November 13 2 | # https://github.com/bevry/base 3 | 4 | # VCS Files 5 | .git 6 | .svn 7 | .hg 8 | 9 | # System Files 10 | **/.DS_Store 11 | 12 | # Temp Files 13 | **/.docpad.db 14 | **/*.log 15 | **/*.cpuprofile 16 | **/*.heapsnapshot 17 | 18 | # Yarn Files 19 | .yarn/* 20 | !.yarn/releases 21 | !.yarn/plugins 22 | !.yarn/sdks 23 | !.yarn/versions 24 | .pnp.* 25 | .pnp/ 26 | 27 | # Build Caches 28 | build/ 29 | components/ 30 | bower_components/ 31 | node_modules/ 32 | 33 | # Build Outputs 34 | **/*.cjs 35 | **/*.mjs 36 | **/out.* 37 | **/*.out.* 38 | **/out/ 39 | **/output/ 40 | *compiled* 41 | edition*/ 42 | coffeejs/ 43 | coffee/ 44 | es5/ 45 | es2015/ 46 | esnext/ 47 | docs/ 48 | 49 | # Development Files 50 | test/ 51 | **/*fixtures* 52 | 53 | # Ecosystem Caches 54 | .trunk/*/ 55 | 56 | # ===================================== 57 | # CUSTOM 58 | 59 | # None 60 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # Before You Post! 7 | 8 | ## Support 9 | 10 | We offer support through our [Official Support Channels](https://bevry.me/support). Do not use GitHub Issues for support, your issue will be closed. 11 | 12 | ## Contribute 13 | 14 | Our [Contributing Guide](https://bevry.me/contribute) contains useful tips and suggestions for how to contribute to this project, it's worth the read. 15 | 16 | ## Development 17 | 18 | ### Setup 19 | 20 | 1. [Install Node.js](https://bevry.me/install/node) 21 | 22 | 1. Fork the project and clone your fork - [guide](https://help.github.com/articles/fork-a-repo/) 23 | 24 | 1. Setup the project for development 25 | 26 | ```bash 27 | npm run our:setup 28 | ``` 29 | 30 | ### Developing 31 | 32 | 1. Compile changes 33 | 34 | ```bash 35 | npm run our:compile 36 | ``` 37 | 38 | 1. Run tests 39 | 40 | ```bash 41 | npm test 42 | ``` 43 | 44 | ### Publishing 45 | 46 | Follow these steps in order to implement your changes/improvements into your desired project: 47 | 48 | #### Preparation 49 | 50 | 1. Make sure your changes are on their own branch that is branched off from master. 51 | 52 | 1. You can do this by: `git checkout master; git checkout -b your-new-branch` 53 | 1. And push the changes up by: `git push origin your-new-branch` 54 | 55 | 1. Ensure all tests pass: 56 | 57 | ```bash 58 | npm test 59 | ``` 60 | 61 | > If possible, add tests for your change, if you don't know how, mention this in your pull request 62 | 63 | 1. Ensure the project is ready for publishing: 64 | 65 | ``` 66 | npm run our:release:prepare 67 | ``` 68 | 69 | #### Pull Request 70 | 71 | To send your changes for the project owner to merge in: 72 | 73 | 1. Submit your pull request 74 | 1. When submitting, if the original project has a `dev` or `integrate` branch, use that as the target branch for your pull request instead of the default `master` 75 | 1. By submitting a pull request you agree for your changes to have the same license as the original plugin 76 | 77 | #### Publish 78 | 79 | To publish your changes as the project owner: 80 | 81 | 1. Switch to the master branch: 82 | 83 | ```bash 84 | git checkout master 85 | ``` 86 | 87 | 1. Merge in the changes of the feature branch (if applicable) 88 | 89 | 1. Increment the version number in the `package.json` file according to the [semantic versioning](http://semver.org) standard, that is: 90 | 91 | 1. `x.0.0` MAJOR version when you make incompatible API changes (note: DocPad plugins must use v2 as the major version, as v2 corresponds to the current DocPad v6.x releases) 92 | 1. `x.y.0` MINOR version when you add functionality in a backwards-compatible manner 93 | 1. `x.y.z` PATCH version when you make backwards-compatible bug fixes 94 | 95 | 1. Add an entry to the changelog following the format of the previous entries, an example of this is: 96 | 97 | ```markdown 98 | ## v6.29.0 2013 April 1 99 | 100 | - Progress on [issue #474](https://github.com/docpad/docpad/issues/474) 101 | - DocPad will now set permissions based on the process's ability 102 | - Thanks to [Avi Deitcher](https://github.com/deitch), [Stephan Lough](https://github.com/stephanlough) for [issue #165](https://github.com/docpad/docpad/issues/165) 103 | - Updated dependencies 104 | ``` 105 | 106 | 1. Commit the changes with the commit title set to something like `v6.29.0. Bugfix. Improvement.` and commit description set to the changelog entry 107 | 108 | 1. Ensure the project is ready for publishing: 109 | 110 | ``` 111 | npm run our:release:prepare 112 | ``` 113 | 114 | 1. Prepare the release and publish it to npm and git: 115 | 116 | ```bash 117 | npm run our:release 118 | ``` 119 | -------------------------------------------------------------------------------- /HISTORY.md: -------------------------------------------------------------------------------- 1 | # History 2 | 3 | ## v8.4.0 2023 December 29 4 | 5 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 6 | - Thank you to the sponsors: [Andrew Nesbitt](https://nesbitt.io), [Balsa](https://balsa.com), [Codecov](https://codecov.io), [Poonacha Medappa](https://poonachamedappa.com), [Rob Morris](https://github.com/Rob-Morris), [Sentry](https://sentry.io), [Syntax](https://syntax.fm) 7 | 8 | ## v8.3.0 2023 December 27 9 | 10 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 11 | - Thank you to the sponsors: [Andrew Nesbitt](https://nesbitt.io), [Balsa](https://balsa.com), [Codecov](https://codecov.io/), [Poonacha Medappa](https://poonachamedappa.com), [Rob Morris](https://github.com/Rob-Morris), [Sentry](https://sentry.io), [Syntax](https://syntax.fm) 12 | 13 | ## v8.2.0 2023 November 24 14 | 15 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 16 | 17 | ## v8.1.0 2023 November 21 18 | 19 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 20 | 21 | ## v8.0.0 2023 November 18 22 | 23 | - Updated CLI to support autodetection of conversion, as well as supporting `--cson2json` and `--json2cson` args, also added `cson` bin 24 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 25 | - Minimum required Node.js version changed from `node: >=10` to `node: >=6` adapting to ecosystem changes 26 | 27 | ## v7.20.0 2020 September 4 28 | 29 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 30 | 31 | ## v7.19.0 2020 August 18 32 | 33 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 34 | 35 | ## v7.18.0 2020 August 4 36 | 37 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 38 | 39 | ## v7.17.0 2020 July 22 40 | 41 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 42 | 43 | ## v7.16.0 2020 July 22 44 | 45 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 46 | 47 | ## v7.15.0 2020 July 3 48 | 49 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 50 | 51 | ## v7.14.0 2020 July 3 52 | 53 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 54 | 55 | ## v7.13.0 2020 July 3 56 | 57 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 58 | 59 | ## v7.12.0 2020 June 25 60 | 61 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 62 | 63 | ## v7.11.0 2020 June 21 64 | 65 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 66 | 67 | ## v7.10.0 2020 June 21 68 | 69 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 70 | 71 | ## v7.9.0 2020 June 20 72 | 73 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 74 | 75 | ## v7.8.0 2020 June 20 76 | 77 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 78 | 79 | ## v7.7.0 2020 June 10 80 | 81 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 82 | 83 | ## v7.6.0 2020 June 10 84 | 85 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 86 | 87 | ## v7.5.0 2020 May 22 88 | 89 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 90 | 91 | ## v7.4.0 2020 May 21 92 | 93 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 94 | 95 | ## v7.3.0 2020 May 12 96 | 97 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 98 | 99 | ## v7.2.0 2020 May 11 100 | 101 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 102 | 103 | ## v7.1.0 2020 May 4 104 | 105 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 106 | 107 | ## v7.0.0 2020 March 26 108 | 109 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 110 | - Minimum required node version changed from `node: >=8` to `node: >=10` to keep up with mandatory ecosystem changes 111 | 112 | ## v6.9.0 2019 December 18 113 | 114 | - Fixed broken `json2cson` and `cson2json` executables (regression since v6.0.0) 115 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 116 | 117 | ## v6.8.0 2019 December 9 118 | 119 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 120 | 121 | ## v6.7.0 2019 December 1 122 | 123 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 124 | 125 | ## v6.6.0 2019 December 1 126 | 127 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 128 | 129 | ## v6.5.0 2019 December 1 130 | 131 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 132 | 133 | ## v6.4.0 2019 November 18 134 | 135 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 136 | 137 | ## v6.3.0 2019 November 18 138 | 139 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 140 | 141 | ## v6.2.0 2019 November 13 142 | 143 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 144 | 145 | ## v6.1.0 2019 November 13 146 | 147 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 148 | 149 | ## v6.0.0 2019 November 11 150 | 151 | - As node v4 is no longer LTS, CSON can now use CoffeeScript v2 152 | - Minimum supported node version changed from v0.8 to the lowest LTS at the time of this release which is version v8 153 | - Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) 154 | 155 | ## v5.1.0 2018 January 25 156 | 157 | - Revert CSON's use of CoffeeScript v2, as it [broke support for Node 4 and below](https://travis-ci.org/bevry/cson/builds/333130290) 158 | - Use of CoffeeScript v2 is now limited to compilation of this project only 159 | 160 | ## v5.0.0 2018 January 25 161 | 162 | - Now uses CoffeeScript v2 163 | - Now uses [editions](https://github.com/bevry/editions) to use the ESNext compiled edition for environments that support it, otherwise use the ES2015 compiled edition 164 | - Updated base files 165 | 166 | ## v4.1.0 2017 April 10 167 | 168 | - `cson2json` and `json2cson` will now output the error if the input file is invalid 169 | - Closes [issue #78](https://github.com/bevry/cson/issues/78) 170 | - Updated base files 171 | 172 | ## v4.0.0 2016 October 20 173 | 174 | - `parseCSString` no longer creates the `sandbox` variable if it was missing, the responsibility of such things should be, and now is, handled via the eval function of coffeescript which is what that method uses - This is a major breaking change as parsing coffeescript files will now by default run still in a virtual machine but now in the global context rather than their own context - If you are parsing untrusted coffeescript files, you should now setup the `sandbox` option yourself with the appropriate values - If you are parsing trusted coffeescript files, or not parsing coffeescript files (e.g. only CSON files), then this change won't impact you - This change is done such that the result object from `parseCSString` passes `result.__proto__ === Object.prototype` which before it did not as the different context caused the prototype to point to a different contexts `Object` causing the assertion to fail 175 | - Updated dependencies 176 | - Updated internal packing conventions 177 | 178 | ## v3.0.2 2015 September 18 179 | 180 | - Updated dependencies to avoid duplicate CoffeeScript installations 181 | 182 | ## v3.0.1 2015 March 16 183 | 184 | - Fixed stdin support on Node 0.8 185 | 186 | ## v3.0.0 2015 March 16 187 | 188 | - Every function now also supports callbacks (2nd or 3rd argument) 189 | - Errors will now always maintain their stacks where possible 190 | - Simplified some aliases (b/c break) - Changed `stringify` to now accept the arguments you would expect `stringify(data, replacer, indent)` - Changed `parse` to delegate to `parseCSONString` instead of `parseString` - Changed `load` to delegate to `parseCSONFile` instead of `parseFile` - Removed `require` (it use to delegate to `requireFile`) 191 | - Updated dependencies 192 | 193 | ## v2.0.0 2015 February 6 194 | 195 | - API has been rewritten to be more robust and simple 196 | - CSON data is now parsed and stringified with the [cson-parser](https://www.npmjs.com/package/cson-parser) package 197 | - CLI now supports stdin input 198 | - Node v0.11 and IO.js support 199 | 200 | ## v1.6.2 2014 December 11 201 | 202 | - Updated dependencies 203 | 204 | ## v1.6.1 2014 August 3 205 | 206 | - Updated dependencies 207 | 208 | ## v1.6.0 2014 May 17 209 | 210 | - Updated dependencies 211 | - Fixed error handling in certain conditions 212 | 213 | ## v1.5.0 2014 February 8th 214 | 215 | - Updated dependencies 216 | 217 | ## v1.4.5 2013 October 31 218 | 219 | - Updated dependencies 220 | 221 | ## v1.4.4 2013 August 30 222 | 223 | - Updated dependencies 224 | 225 | ## v1.4.3 2013 August 30 226 | 227 | - Better error handling when requiring a file that has syntax errors 228 | - Fixed stringify of '{}' giving '{{}}' which is invalid - Closes [issue #21](https://github.com/bevry/cson/issues/21) 229 | 230 | ## v1.4.2 2013 June 7 231 | 232 | - Updated dependencies 233 | 234 | ## v1.4.1 2013 March 16 235 | 236 | - Added `npm-shrinkwrap.json` that ensures `js2coffee` uses `coffee-script` 1.4.0 237 | - Updated dependencies 238 | 239 | ## v1.4.0 2012 October 25 240 | 241 | - Dropped require extensions following [CoffeeScript's lead](https://github.com/jashkenas/coffee-script/issues/2441) - If you still want them, add them to your application manually 242 | - Updated dependencies - coffee-script 1.3.x to 1.4.x 243 | 244 | ## v1.3.0 2012 September 1 245 | 246 | - You can now use `require` to require CSON files - Thanks to [Linus G Thiel](https://github.com/linus) for [pull request #16](https://github.com/bevry/cson/pull/16) 247 | - Drops node v0.4 support, min supported version now v0.6 248 | 249 | ## v1.2.3 2012 September 1 250 | 251 | - Fixed `json2cson` and `cson2json` binaries - Thanks to [Zhang Cheng](https://github.com/zhangcheng) for [pull request #15](https://github.com/bevry/cson/pull/15) 252 | 253 | ## v1.2.2 2012 August 10 254 | 255 | - Re-added markdown files to npm distribution as they are required for the npm website 256 | 257 | ## v1.2.1 2012 July 16 258 | 259 | - Fixed try surrounding a next callback 260 | 261 | ## v1.2.0 2012 July 7 262 | 263 | - CSON files are now sandboxed by default, ensuring they can't do bad stuff to your global scope 264 | - Added `opts` as the middle argument for `parseFile`, `parseFileSync`, `parse`, and `parseSync` functions - You can use this to specify `sandbox: false` if you do not want sandboxing on CSON files 265 | 266 | ## v1.1.2 2012 June 22 267 | 268 | - We no longer have `require` cache our configuration files 269 | 270 | ## v1.1.1 2012 June 21 271 | 272 | - Fixed main file location 273 | 274 | ## v1.1.0 2012 June 21 275 | 276 | - Parsing file changes - If files have `js` or `coffee` extension, will try to require them - If files have `json` or `cson` extension, will try to read them - Otherwise will throw an unknown extension error 277 | - Moved tests from Mocha to [Joe](https://github.com/bevry/joe) 278 | 279 | ## v1.0.2 2012 May 04 280 | 281 | - Fixed some CSON use cases and added more unit tests 282 | 283 | ## v1.0.1 2012 May 04 284 | 285 | - Async calls now act asynchronously - Thanks to [Ryan LeFevre](https://github.com/meltingice) for [pull request #10](https://github.com/bevry/cson/pull/10) - 286 | 287 | ## v1.0.0 2012 April 23 288 | 289 | - Updated tests 290 | - Updated `package.json` for latest npm 291 | - Cleaned up the code 292 | - CoffeeScript dependency is now local 293 | - Added synchronous API calls to the README 294 | - Stringify functions now output CSON strings, instead of JSON strings - Use `JSON.stringify` if you want JSON strings 295 | - Added `json2cson` and `cson2json` bin tools 296 | 297 | ## v0.2 2011 August 10 298 | 299 | - Added synchronous interface thanks to [clyfe](https://github.com/clyfe) - closes issue [#1](https://github.com/balupton/cson.npm/issues/1) and [#3](https://github.com/balupton/cson.npm/pull/3) 300 | 301 | ## v0.1 2011 June 2 302 | 303 | - Initial commit 304 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # License 4 | 5 | Unless stated otherwise all works are: 6 | 7 | - Copyright © [Benjamin Lupton](https://balupton.com) 8 | 9 | and licensed under: 10 | 11 | - [Artistic License 2.0](http://spdx.org/licenses/Artistic-2.0.html) 12 | 13 | ## The Artistic License 2.0 14 | 15 |
 16 | Copyright (c) 2000-2006, The Perl Foundation.
 17 | 
 18 | Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
 19 | 
 20 | Preamble
 21 | 
 22 | This license establishes the terms under which a given free software Package may be copied, modified, distributed, and/or redistributed. The intent is that the Copyright Holder maintains some artistic control over the development of that Package while still keeping the Package available as open source and free software.
 23 | 
 24 | You are always permitted to make arrangements wholly outside of this license directly with the Copyright Holder of a given Package.  If the terms of this license do not permit the full use that you propose to make of the Package, you should contact the Copyright Holder and seek a different licensing arrangement.
 25 | 
 26 | Definitions
 27 | 
 28 |      "Copyright Holder" means the individual(s) or organization(s) named in the copyright notice for the entire Package.
 29 | 
 30 |      "Contributor" means any party that has contributed code or other material to the Package, in accordance with the Copyright Holder's procedures.
 31 | 
 32 |      "You" and "your" means any person who would like to copy, distribute, or modify the Package.
 33 | 
 34 |      "Package" means the collection of files distributed by the Copyright Holder, and derivatives of that collection and/or of those files. A given Package may consist of either the Standard Version, or a Modified Version.
 35 | 
 36 |      "Distribute" means providing a copy of the Package or making it accessible to anyone else, or in the case of a company or organization, to others outside of your company or organization.
 37 | 
 38 |      "Distributor Fee" means any fee that you charge for Distributing this Package or providing support for this Package to another party.  It does not mean licensing fees.
 39 | 
 40 |      "Standard Version" refers to the Package if it has not been modified, or has been modified only in ways explicitly requested by the Copyright Holder.
 41 | 
 42 |      "Modified Version" means the Package, if it has been changed, and such changes were not explicitly requested by the Copyright Holder.
 43 | 
 44 |      "Original License" means this Artistic License as Distributed with the Standard Version of the Package, in its current version or as it may be modified by The Perl Foundation in the future.
 45 | 
 46 |      "Source" form means the source code, documentation source, and configuration files for the Package.
 47 | 
 48 |      "Compiled" form means the compiled bytecode, object code, binary, or any other form resulting from mechanical transformation or translation of the Source form.
 49 | 
 50 | Permission for Use and Modification Without Distribution
 51 | 
 52 | (1) You are permitted to use the Standard Version and create and use Modified Versions for any purpose without restriction, provided that you do not Distribute the Modified Version.
 53 | 
 54 | Permissions for Redistribution of the Standard Version
 55 | 
 56 | (2) You may Distribute verbatim copies of the Source form of the Standard Version of this Package in any medium without restriction, either gratis or for a Distributor Fee, provided that you duplicate all of the original copyright notices and associated disclaimers.  At your discretion, such verbatim copies may or may not include a Compiled form of the Package.
 57 | 
 58 | (3) You may apply any bug fixes, portability changes, and other modifications made available from the Copyright Holder.  The resulting Package will still be considered the Standard Version, and as such will be subject to the Original License.
 59 | 
 60 | Distribution of Modified Versions of the Package as Source
 61 | 
 62 | (4) You may Distribute your Modified Version as Source (either gratis or for a Distributor Fee, and with or without a Compiled form of the Modified Version) provided that you clearly document how it differs from the Standard Version, including, but not limited to, documenting any non-standard features, executables, or modules, and provided that you do at least ONE of the following:
 63 | 
 64 |      (a) make the Modified Version available to the Copyright Holder of the Standard Version, under the Original License, so that the Copyright Holder may include your modifications in the Standard Version.
 65 |      (b) ensure that installation of your Modified Version does not prevent the user installing or running the Standard Version. In addition, the Modified Version must bear a name that is different from the name of the Standard Version.
 66 |      (c) allow anyone who receives a copy of the Modified Version to make the Source form of the Modified Version available to others under
 67 | 
 68 |           (i) the Original License or
 69 |           (ii) a license that permits the licensee to freely copy, modify and redistribute the Modified Version using the same licensing terms that apply to the copy that the licensee received, and requires that the Source form of the Modified Version, and of any works derived from it, be made freely available in that license fees are prohibited but Distributor Fees are allowed.
 70 | 
 71 | Distribution of Compiled Forms of the Standard Version or Modified Versions without the Source
 72 | 
 73 | (5)  You may Distribute Compiled forms of the Standard Version without the Source, provided that you include complete instructions on how to get the Source of the Standard Version.  Such instructions must be valid at the time of your distribution.  If these instructions, at any time while you are carrying out such distribution, become invalid, you must provide new instructions on demand or cease further distribution. If you provide valid instructions or cease distribution within thirty days after you become aware that the instructions are invalid, then you do not forfeit any of your rights under this license.
 74 | 
 75 | (6)  You may Distribute a Modified Version in Compiled form without the Source, provided that you comply with Section 4 with respect to the Source of the Modified Version.
 76 | 
 77 | Aggregating or Linking the Package
 78 | 
 79 | (7)  You may aggregate the Package (either the Standard Version or Modified Version) with other packages and Distribute the resulting aggregation provided that you do not charge a licensing fee for the Package.  Distributor Fees are permitted, and licensing fees for other components in the aggregation are permitted. The terms of this license apply to the use and Distribution of the Standard or Modified Versions as included in the aggregation.
 80 | 
 81 | (8) You are permitted to link Modified and Standard Versions with other works, to embed the Package in a larger work of your own, or to build stand-alone binary or bytecode versions of applications that include the Package, and Distribute the result without restriction, provided the result does not expose a direct interface to the Package.
 82 | 
 83 | Items That are Not Considered Part of a Modified Version
 84 | 
 85 | (9) Works (including, but not limited to, modules and scripts) that merely extend or make use of the Package, do not, by themselves, cause the Package to be a Modified Version.  In addition, such works are not considered parts of the Package itself, and are not subject to the terms of this license.
 86 | 
 87 | General Provisions
 88 | 
 89 | (10)  Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license.
 90 | 
 91 | (11)  If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.
 92 | 
 93 | (12)  This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder.
 94 | 
 95 | (13)  This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed.
 96 | 
 97 | (14)  Disclaimer of Warranty:
 98 | THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 99 | 
100 | 101 | 102 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # CSON 4 | 5 | 6 | 7 | 8 | 9 | Status of the GitHub Workflow: bevry 10 | NPM version 11 | NPM downloads 12 |
13 | GitHub Sponsors donate button 14 | ThanksDev donate button 15 | Patreon donate button 16 | Liberapay donate button 17 | Buy Me A Coffee donate button 18 | Open Collective donate button 19 | crypto donate button 20 | PayPal donate button 21 |
22 | Discord server badge 23 | Twitch community badge 24 | 25 | 26 | 27 | 28 | CoffeeScript-Object-Notation. Same as JSON but for CoffeeScript objects. 29 | 30 | [Projects using CSON.](https://www.npmjs.org/browse/depended/cson) 31 | 32 | [Projects using CSON Parser directly.](https://www.npmjs.org/browse/depended/cson-parser) 33 | 34 | Since v2, this CSON package is a higher-level wrapper around the lower-level [CSON Parser](https://www.npmjs.com/package/cson-parser). 35 | 36 | 37 | 38 | 39 | 40 | ## What is CSON? 41 | 42 | Everyone knows JSON, it's the thing that looks like this: 43 | 44 | ``` javascript 45 | { 46 | "greatDocumentaries": [ 47 | "earthlings.com", 48 | "forksoverknives.com", 49 | "cowspiracy.com" 50 | ], 51 | "importantFacts": { 52 | "emissions": "Livestock and their byproducts account for at least 32,000 million tons of carbon dioxide (CO2) per year, or 51% of all worldwide greenhouse gas emissions.\nGoodland, R Anhang, J. “Livestock and Climate Change: What if the key actors in climate change were pigs, chickens and cows?”\nWorldWatch, November/December 2009. Worldwatch Institute, Washington, DC, USA. Pp. 10–19.\nhttp://www.worldwatch.org/node/6294", 53 | "landuse": "Livestock covers 45% of the earth’s total land.\nThornton, Phillip, Mario Herrero, and Polly Ericksen. “Livestock and Climate Change.” Livestock Exchange, no. 3 (2011).\nhttps://cgspace.cgiar.org/bitstream/handle/10568/10601/IssueBrief3.pdf", 54 | "burger": "One hamburger requires 660 gallons of water to produce – the equivalent of 2 months’ worth of showers.\nCatanese, Christina. “Virtual Water, Real Impacts.” Greenversations: Official Blog of the U.S. EPA. 2012.\nhttp://blog.epa.gov/healthywaters/2012/03/virtual-water-real-impacts-world-water-day-2012/\n“50 Ways to Save Your River.” Friends of the River.\nhttp://www.friendsoftheriver.org/site/PageServer?pagename=50ways", 55 | "milk": "1,000 gallons of water are required to produce 1 gallon of milk.\n“Water trivia facts.” United States Environmental Protection Agency.\nhttp://water.epa.gov/learn/kids/drinkingwater/water_trivia_facts.cfm#_edn11", 56 | "more": "http://cowspiracy.com/facts" 57 | } 58 | } 59 | ``` 60 | 61 | Now let's write the same thing in CSON: 62 | 63 | ``` coffeescript 64 | # Comments!!! 65 | 66 | # An Array with no commas! 67 | greatDocumentaries: [ 68 | 'earthlings.com' 69 | 'forksoverknives.com' 70 | 'cowspiracy.com' 71 | ] 72 | 73 | # An Object without braces! 74 | importantFacts: 75 | # Multi-Line Strings! Without Quote Escaping! 76 | emissions: ''' 77 | Livestock and their byproducts account for at least 32,000 million tons of carbon dioxide (CO2) per year, or 51% of all worldwide greenhouse gas emissions. 78 | Goodland, R Anhang, J. “Livestock and Climate Change: What if the key actors in climate change were pigs, chickens and cows?” 79 | WorldWatch, November/December 2009. Worldwatch Institute, Washington, DC, USA. Pp. 10–19. 80 | http://www.worldwatch.org/node/6294 81 | ''' 82 | 83 | landuse: ''' 84 | Livestock covers 45% of the earth’s total land. 85 | Thornton, Phillip, Mario Herrero, and Polly Ericksen. “Livestock and Climate Change.” Livestock Exchange, no. 3 (2011). 86 | https://cgspace.cgiar.org/bitstream/handle/10568/10601/IssueBrief3.pdf 87 | ''' 88 | 89 | burger: ''' 90 | One hamburger requires 660 gallons of water to produce – the equivalent of 2 months’ worth of showers. 91 | Catanese, Christina. “Virtual Water, Real Impacts.” Greenversations: Official Blog of the U.S. EPA. 2012. 92 | http://blog.epa.gov/healthywaters/2012/03/virtual-water-real-impacts-world-water-day-2012/ 93 | “50 Ways to Save Your River.” Friends of the River. 94 | http://www.friendsoftheriver.org/site/PageServer?pagename=50ways 95 | ''' 96 | 97 | milk: ''' 98 | 1,000 gallons of water are required to produce 1 gallon of milk. 99 | “Water trivia facts.” United States Environmental Protection Agency. 100 | http://water.epa.gov/learn/kids/drinkingwater/water_trivia_facts.cfm#_edn11 101 | ''' 102 | 103 | more: 'http://cowspiracy.com/facts' 104 | ``` 105 | 106 | Which is far more lenient than JSON, way nicer to write and read, no need to quote and escape everything, has comments and readable multi-line strings, and won't fail if you forget a comma. 107 | 108 | 109 | 110 | ## Using CSON 111 | 112 | ### Via the Command Line 113 | 114 | Use CSON with the command line with: 115 | 116 | ``` bash 117 | # Convert a JSON file into a CSON file 118 | json2cson in.json > out.cson 119 | # Same thing via piping 120 | cat in.json | json2cson > out.cson 121 | 122 | # Convert a CSON file into a JSON file 123 | cson2json in.cson > out.json 124 | # Same thing via piping 125 | cat in.cson | cson2json > out.json 126 | ``` 127 | 128 | Requires a global CSON install: `npm install -g cson` 129 | 130 | 131 | ### Via the API 132 | 133 | Include CSON: 134 | 135 | ``` javascript 136 | var CSON = require('cson') 137 | ``` 138 | 139 | Each method can be executed without a callback like so: 140 | 141 | ``` javascript 142 | var result = CSON.createCSONString({a:{b:'c'}}, {/* optional options argument */}) 143 | if ( result instanceof Error ) { 144 | console.log(result.stack) 145 | } else { 146 | console.log(result) 147 | } 148 | ``` 149 | 150 | Or via a callback like so: 151 | 152 | ``` javascript 153 | CSON.createCSONString({a:{b:'c'}}, {/* optional options argument */}, function(err,result){ 154 | console.log(err, result) 155 | }) 156 | ``` 157 | 158 | Executing the method with a callback still executes the method synchronously. 159 | 160 | Click the below function names to open more detailed documentation. 161 | 162 | 163 | #### Create Strings 164 | 165 | - String CSON.stringify(data, replacer?, indent?)
Converts an Object into a CSON String 166 | 167 | - String CSON.createCSONString(data, opts?, next?)
Converts an Object into a CSON String 168 | 169 | - String CSON.createJSONString(data, opts?, next?)
Converts an Object into a JSON String 170 | 171 | - String CSON.createString(data, opts?, next?)
Converts an Object into a String of the desired format If the format option is not specified, we default to CSON 172 | 173 | 174 | ### Parse Strings 175 | 176 | - Object CSON.parse(data, opts?, next?)
Parses a CSON String into an Object 177 | 178 | - Object CSON.parseCSONString(data, opts?, next?)
Parses a CSON String into an Object 179 | 180 | - Object CSON.parseJSONString(data, opts?, next?)
Parses a JSON String into an Object 181 | 182 | - Object CSON.parseCSString(data, opts?, next?)
Parses a CoffeeScript String into an Object 183 | 184 | - Object CSON.parseJSString(data, opts?, next?)
Parses a JavaScript String into an Object 185 | 186 | - Object CSON.parseString(data, opts?, next?)
Converts a String of the desired format into an Object If the format option is not specified, we default to CSON 187 | 188 | 189 | #### Parse Files 190 | 191 | - Object CSON.load(filePath, opts?, next?)
Parses a CSON file into an Object 192 | 193 | - Object CSON.parseCSONFile(filePath, opts?, next?)
Parses a CSON file into an Object 194 | 195 | - Object CSON.parseJSONFile(filePath, opts?, next?)
Parses a JSON file into an Object 196 | 197 | - Object CSON.parseCSFile(filePath, opts?, next?)
Parses a CoffeeScript file into an Object 198 | 199 | - Object CSON.parseJSFile(filePath, opts?, next?)
Parses a JavaScript file into an Object 200 | 201 | - Object CSON.parseFile(filePath, opts?, next?)
Parses a file path of the desired format into an Object If the format option is not specified, we use the filename to detect what it should be, otherwise we default to CSON 202 | 203 | 204 | ### Require Files 205 | 206 | - Object CSON.requireCSFile(filePath, opts?, next?)
Requires a CoffeeScript file and returns the result Object 207 | 208 | - Object CSON.requireJSFile(filePath, opts?, next?)
Requires a JavaScript file and returns the result Object 209 | 210 | - Object CSON.requireFile(filePath, opts?, next?)
Requires or parses a file path of the desired format into an Object If the format option is not specified, we use the filename to detect what it should be, otherwise we default to parsing CSON 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | ## Install 324 | 325 | ### [npm](https://npmjs.com "npm is a package manager for javascript") 326 | 327 | #### Install Globally 328 | 329 | - Install: `npm install --global cson` 330 | - Executables: `cson`, `cson2json`, `json2cson` 331 | 332 | #### Install Locally 333 | 334 | - Install: `npm install --save cson` 335 | - Executables: `npx cson`, `npx cson2json`, `npx json2cson` 336 | - Import: `import * as pkg from ('cson')` 337 | - Require: `const pkg = require('cson')` 338 | 339 | ### [Editions](https://editions.bevry.me "Editions are the best way to produce and consume packages you care about.") 340 | 341 | This package is published with the following editions: 342 | - `cson/source/index.coffee` is [CoffeeScript](https://coffeescript.org "CoffeeScript is a little language that compiles into JavaScript") source code with [Require](https://nodejs.org/dist/latest-v5.x/docs/api/modules.html "Node/CJS Modules") for modules 343 | - `cson` aliases `cson/edition-esnext/index.js` 344 | - `cson/edition-esnext/index.js` is [CoffeeScript](https://coffeescript.org "CoffeeScript is a little language that compiles into JavaScript") compiled for [Node.js](https://nodejs.org "Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine") 6 || 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21 with [Require](https://nodejs.org/dist/latest-v5.x/docs/api/modules.html "Node/CJS Modules") for modules 345 | 346 | 347 | 348 | 349 | 350 | ## History 351 | 352 | [Discover the release history by heading on over to the `HISTORY.md` file.](https://github.com/bevry/cson/blob/HEAD/HISTORY.md#files) 353 | 354 | 355 | 356 | 357 | 358 | ## Backers 359 | 360 | ### Code 361 | 362 | [Discover how to contribute via the `CONTRIBUTING.md` file.](https://github.com/bevry/cson/blob/HEAD/CONTRIBUTING.md#files) 363 | 364 | #### Authors 365 | 366 | - [Benjamin Lupton](https://balupton.com) — Accelerating collaborative wisdom. 367 | 368 | #### Maintainers 369 | 370 | - [Benjamin Lupton](https://balupton.com) — Accelerating collaborative wisdom. 371 | 372 | #### Contributors 373 | 374 | - [Attila Oláh](https://github.com/attilaolah) — [view contributions](https://github.com/bevry/cson/commits?author=attilaolah "View the GitHub contributions of Attila Oláh on repository bevry/cson") 375 | - [Attila Oláh](https://attilaolah.eu) 376 | - [Benjamin Lupton](https://github.com/balupton) — [view contributions](https://github.com/bevry/cson/commits?author=balupton "View the GitHub contributions of Benjamin Lupton on repository bevry/cson") 377 | - [Claudius Nicolae](https://github.com/clyfe) — [view contributions](https://github.com/bevry/cson/commits?author=clyfe "View the GitHub contributions of Claudius Nicolae on repository bevry/cson") 378 | - [evinugur](https://github.com/evinugur) — [view contributions](https://github.com/bevry/cson/commits?author=evinugur "View the GitHub contributions of evinugur on repository bevry/cson") 379 | - [Jason Karns](https://github.com/jasonkarns) — [view contributions](https://github.com/bevry/cson/commits?author=jasonkarns "View the GitHub contributions of Jason Karns on repository bevry/cson") 380 | - [Joël Perras](https://github.com/jperras) — [view contributions](https://github.com/bevry/cson/commits?author=jperras "View the GitHub contributions of Joël Perras on repository bevry/cson") 381 | - [Linus G Thiel](https://github.com/linus) — [view contributions](https://github.com/bevry/cson/commits?author=linus "View the GitHub contributions of Linus G Thiel on repository bevry/cson") 382 | - [Rob Loach](https://github.com/RobLoach) — [view contributions](https://github.com/bevry/cson/commits?author=RobLoach "View the GitHub contributions of Rob Loach on repository bevry/cson") 383 | - [Ryan LeFevre](https://github.com/meltingice) — [view contributions](https://github.com/bevry/cson/commits?author=meltingice "View the GitHub contributions of Ryan LeFevre on repository bevry/cson") 384 | - [Tushar Kant](https://github.com/nanuclickity) — [view contributions](https://github.com/bevry/cson/commits?author=nanuclickity "View the GitHub contributions of Tushar Kant on repository bevry/cson") 385 | - [Zearin](https://github.com/Zearin) — [view contributions](https://github.com/bevry/cson/commits?author=Zearin "View the GitHub contributions of Zearin on repository bevry/cson") 386 | - [ZHANG Cheng](https://github.com/zhangcheng) — [view contributions](https://github.com/bevry/cson/commits?author=zhangcheng "View the GitHub contributions of ZHANG Cheng on repository bevry/cson") 387 | 388 | ### Finances 389 | 390 | GitHub Sponsors donate button 391 | ThanksDev donate button 392 | Patreon donate button 393 | Liberapay donate button 394 | Buy Me A Coffee donate button 395 | Open Collective donate button 396 | crypto donate button 397 | PayPal donate button 398 | 399 | #### Sponsors 400 | 401 | - [Andrew Nesbitt](https://nesbitt.io) — Software engineer and researcher 402 | - [Balsa](https://balsa.com) — We're Balsa, and we're building tools for builders. 403 | - [Codecov](https://codecov.io) — Empower developers with tools to improve code quality and testing. 404 | - [Poonacha Medappa](https://poonachamedappa.com) 405 | - [Rob Morris](https://github.com/Rob-Morris) 406 | - [Sentry](https://sentry.io) — Real-time crash reporting for your web apps, mobile apps, and games. 407 | - [Syntax](https://syntax.fm) — Syntax Podcast 408 | 409 | #### Donors 410 | 411 | - [Andrew Nesbitt](https://nesbitt.io) 412 | - [Armen Mkrtchian](https://mogoni.dev) 413 | - [Balsa](https://balsa.com) 414 | - [Chad](https://opencollective.com/chad8) 415 | - [Codecov](https://codecov.io) 416 | - [dr.dimitru](https://veliovgroup.com) 417 | - [Elliott Ditman](https://elliottditman.com) 418 | - [entroniq](https://gitlab.com/entroniq) 419 | - [GitHub](https://github.com/about) 420 | - [Hunter Beast](https://cryptoquick.com) 421 | - [Jean-Luc Geering](https://github.com/jlgeering) 422 | - [Michael Duane Mooring](https://mdm.cc) 423 | - [Michael Harry Scepaniak](https://michaelscepaniak.com) 424 | - [Mohammed Shah](https://github.com/smashah) 425 | - [Mr. Henry](https://mrhenry.be) 426 | - [Nermal](https://arjunaditya.vercel.app) 427 | - [Pleo](https://pleo.io) 428 | - [Poonacha Medappa](https://poonachamedappa.com) 429 | - [Rob Morris](https://github.com/Rob-Morris) 430 | - [Robert de Forest](https://github.com/rdeforest) 431 | - [Sentry](https://sentry.io) 432 | - [ServieJS](https://github.com/serviejs) 433 | - [Skunk Team](https://skunk.team) 434 | - [Syntax](https://syntax.fm) 435 | - [WriterJohnBuck](https://github.com/WriterJohnBuck) 436 | 437 | 438 | 439 | 440 | 441 | ## License 442 | 443 | Unless stated otherwise all works are: 444 | 445 | - Copyright © [Benjamin Lupton](https://balupton.com) 446 | 447 | and licensed under: 448 | 449 | - [Artistic License 2.0](http://spdx.org/licenses/Artistic-2.0.html) 450 | 451 | 452 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Security Practices 4 | 5 | This project meets standardized secure software development practices, including 2FA for all members, password managers with monitoring, secure secret retrieval instead of storage. [Learn about our practices.](https://tidelift.com/funding/github/npm/cson) 6 | 7 | ## Supported Versions 8 | 9 | This project uses [Bevry's automated tooling](https://github.com/bevry/boundation) to deliver the latest updates, fixes, and improvements inside the latest release while still maintaining widespread ecosystem compatibility. 10 | 11 | [Refer to supported ecosystem versions: `Editions` section in `README.md`](https://github.com/bevry/cson/blob/master/README.md#Editions) 12 | 13 | [Refer to automated support of ecosystem versions: `boundation` entries in `HISTORY.md`](https://github.com/bevry/cson/blob/master/HISTORY.md) 14 | 15 | Besides testing and verification, out CI also [auto-merges](https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions) [Dependabot security updates](https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates) and [auto-publishes](https://github.com/bevry-actions/npm) successful builds of the [`master` branch](https://github.com/bevry/wait/actions?query=branch%3Amaster) to the [`next` version tag](https://www.npmjs.com/package/cson?activeTab=versions), offering immediate resolutions before scheduled maintenance releases. 16 | 17 | ## Reporting a Vulnerability 18 | 19 | [Report the vulnerability to the project owners.](https://github.com/bevry/cson/security/advisories) 20 | 21 | [Report the vulnerability to Tidelift.](https://tidelift.com/security) -------------------------------------------------------------------------------- /bin.cjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 'use strict' 3 | // auto-generated by boundation, do not update manually 4 | module.exports = require('./edition-esnext/bin.js') -------------------------------------------------------------------------------- /coffeelint.json: -------------------------------------------------------------------------------- 1 | { 2 | "coffeescript_error": { 3 | "level": "error" 4 | }, 5 | "arrow_spacing": { 6 | "name": "arrow_spacing", 7 | "level": "error" 8 | }, 9 | "no_tabs": { 10 | "name": "no_tabs", 11 | "level": "ignore" 12 | }, 13 | "no_trailing_whitespace": { 14 | "name": "no_trailing_whitespace", 15 | "level": "error", 16 | "allowed_in_comments": false, 17 | "allowed_in_empty_lines": true 18 | }, 19 | "max_line_length": { 20 | "name": "max_line_length", 21 | "value": 80, 22 | "level": "ignore", 23 | "limitComments": true 24 | }, 25 | "line_endings": { 26 | "name": "line_endings", 27 | "level": "error", 28 | "value": "unix" 29 | }, 30 | "no_trailing_semicolons": { 31 | "name": "no_trailing_semicolons", 32 | "level": "error" 33 | }, 34 | "indentation": { 35 | "name": "indentation", 36 | "value": 1, 37 | "level": "error" 38 | }, 39 | "camel_case_classes": { 40 | "name": "camel_case_classes", 41 | "level": "error" 42 | }, 43 | "colon_assignment_spacing": { 44 | "name": "colon_assignment_spacing", 45 | "level": "ignore", 46 | "spacing": { 47 | "left": 0, 48 | "right": 0 49 | } 50 | }, 51 | "no_implicit_braces": { 52 | "name": "no_implicit_braces", 53 | "level": "ignore", 54 | "strict": true 55 | }, 56 | "no_plusplus": { 57 | "name": "no_plusplus", 58 | "level": "ignore" 59 | }, 60 | "no_throwing_strings": { 61 | "name": "no_throwing_strings", 62 | "level": "error" 63 | }, 64 | "no_backticks": { 65 | "name": "no_backticks", 66 | "level": "ignore" 67 | }, 68 | "no_implicit_parens": { 69 | "name": "no_implicit_parens", 70 | "level": "ignore" 71 | }, 72 | "no_empty_param_list": { 73 | "name": "no_empty_param_list", 74 | "level": "error" 75 | }, 76 | "no_stand_alone_at": { 77 | "name": "no_stand_alone_at", 78 | "level": "ignore" 79 | }, 80 | "space_operators": { 81 | "name": "space_operators", 82 | "level": "ignore" 83 | }, 84 | "duplicate_key": { 85 | "name": "duplicate_key", 86 | "level": "error" 87 | }, 88 | "empty_constructor_needs_parens": { 89 | "name": "empty_constructor_needs_parens", 90 | "level": "ignore" 91 | }, 92 | "cyclomatic_complexity": { 93 | "name": "cyclomatic_complexity", 94 | "value": 10, 95 | "level": "ignore" 96 | }, 97 | "newlines_after_classes": { 98 | "name": "newlines_after_classes", 99 | "value": 3, 100 | "level": "ignore" 101 | }, 102 | "no_unnecessary_fat_arrows": { 103 | "name": "no_unnecessary_fat_arrows", 104 | "level": "warn" 105 | }, 106 | "missing_fat_arrows": { 107 | "name": "missing_fat_arrows", 108 | "level": "ignore" 109 | }, 110 | "non_empty_constructor_needs_parens": { 111 | "name": "non_empty_constructor_needs_parens", 112 | "level": "ignore" 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cson", 3 | "version": "8.4.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "cson", 9 | "version": "8.4.0", 10 | "license": "Artistic-2.0", 11 | "dependencies": { 12 | "cson-parser": "^4.0.9", 13 | "extract-opts": "^5.8.0", 14 | "requirefresh": "^5.13.0", 15 | "safefs": "^8.9.0" 16 | }, 17 | "bin": { 18 | "cson": "bin.cjs", 19 | "cson2json": "bin.cjs", 20 | "json2cson": "bin.cjs" 21 | }, 22 | "devDependencies": { 23 | "assert-helpers": "^11.12.0", 24 | "coffeelint": "^2.1.0", 25 | "coffeescript": "^2.7.0", 26 | "kava": "^7.8.0", 27 | "projectz": "^4.1.1", 28 | "safeps": "^11.6.0", 29 | "valid-directory": "^4.8.0" 30 | }, 31 | "engines": { 32 | "node": ">=6" 33 | }, 34 | "funding": { 35 | "url": "https://bevry.me/fund" 36 | } 37 | }, 38 | "node_modules/@bevry/ansi": { 39 | "version": "6.9.0", 40 | "resolved": "https://registry.npmjs.org/@bevry/ansi/-/ansi-6.9.0.tgz", 41 | "integrity": "sha512-0XF5KVdRyjtw5+iVWBeEFOVvnKyQd/V8wSNYRDdWdvLvebzHw8UUkO6Iea78m7yevXZ99oHpv/6F7agdIG6t2g==", 42 | "dev": true, 43 | "dependencies": { 44 | "editions": "^6.20.0" 45 | }, 46 | "engines": { 47 | "node": ">=4" 48 | }, 49 | "funding": { 50 | "url": "https://bevry.me/fund" 51 | } 52 | }, 53 | "node_modules/@bevry/argument": { 54 | "version": "1.2.0", 55 | "resolved": "https://registry.npmjs.org/@bevry/argument/-/argument-1.2.0.tgz", 56 | "integrity": "sha512-kVMvCrAXMHlTIxUzwVtcIh69eEXEsmnx2PEwOHZz2n5pb6PXXdMvLW9uMO0Gi2qfqdTJoLtFe5DeZeGKn78IxQ==", 57 | "dev": true, 58 | "dependencies": { 59 | "errlop": "^8.4.0" 60 | }, 61 | "engines": { 62 | "node": ">=4" 63 | }, 64 | "funding": { 65 | "url": "https://bevry.me/fund" 66 | } 67 | }, 68 | "node_modules/@bevry/fs-accessible": { 69 | "version": "2.5.0", 70 | "resolved": "https://registry.npmjs.org/@bevry/fs-accessible/-/fs-accessible-2.5.0.tgz", 71 | "integrity": "sha512-26z3V6kklpPRQ8M4U4zSRWMgMztsYVxBWM95ZNkFqeMsbNEQoUy8KnxmauhqKHG8FGODd/5hZN4N9fkajJLGYQ==", 72 | "dev": true, 73 | "dependencies": { 74 | "editions": "^6.21.0" 75 | }, 76 | "engines": { 77 | "node": ">=4" 78 | }, 79 | "funding": { 80 | "url": "https://bevry.me/fund" 81 | } 82 | }, 83 | "node_modules/@bevry/fs-list": { 84 | "version": "2.6.0", 85 | "resolved": "https://registry.npmjs.org/@bevry/fs-list/-/fs-list-2.6.0.tgz", 86 | "integrity": "sha512-O0mqCm9/ajbyiOegZ0Wt6i5iMpIA3/eRP11a7yrRV/aoESlIjOKTalfQGXTICBvyIYnVGhPmsZCC9bI38lDB7A==", 87 | "dev": true, 88 | "dependencies": { 89 | "@bevry/fs-accessible": "^2.5.0", 90 | "editions": "^6.21.0", 91 | "errlop": "^8.4.0", 92 | "version-compare": "^3.10.0" 93 | }, 94 | "engines": { 95 | "node": ">=4" 96 | }, 97 | "funding": { 98 | "url": "https://bevry.me/fund" 99 | } 100 | }, 101 | "node_modules/@bevry/fs-mkdirp": { 102 | "version": "1.6.0", 103 | "resolved": "https://registry.npmjs.org/@bevry/fs-mkdirp/-/fs-mkdirp-1.6.0.tgz", 104 | "integrity": "sha512-7oSExHck8ccH13BsZlS5yPHQsitndAlwefIYqohA2tnxWwiNHfQ7glMZtfVKZ633rWyA6azHDei/6Q86deYJ9Q==", 105 | "dev": true, 106 | "dependencies": { 107 | "@bevry/fs-accessible": "^2.5.0", 108 | "editions": "^6.21.0", 109 | "errlop": "^8.4.0", 110 | "version-compare": "^3.10.0" 111 | }, 112 | "engines": { 113 | "node": ">=4" 114 | }, 115 | "funding": { 116 | "url": "https://bevry.me/fund" 117 | } 118 | }, 119 | "node_modules/@bevry/fs-read": { 120 | "version": "1.6.0", 121 | "resolved": "https://registry.npmjs.org/@bevry/fs-read/-/fs-read-1.6.0.tgz", 122 | "integrity": "sha512-ZgF2UdsY4ZiWLaJETFy/JeQu0xH+Xjo60G1gDRc5wzUPllFhFhgbxuqQbfT6+YTn/wpFBzmqsb5+YFJbZdJQ9Q==", 123 | "dev": true, 124 | "dependencies": { 125 | "@bevry/fs-accessible": "^2.5.0", 126 | "editions": "^6.21.0", 127 | "errlop": "^8.4.0" 128 | }, 129 | "engines": { 130 | "node": ">=4" 131 | }, 132 | "funding": { 133 | "url": "https://bevry.me/fund" 134 | } 135 | }, 136 | "node_modules/@bevry/fs-readable": { 137 | "version": "2.5.0", 138 | "resolved": "https://registry.npmjs.org/@bevry/fs-readable/-/fs-readable-2.5.0.tgz", 139 | "integrity": "sha512-NTHG+xYRWRDCLawrhUJEjmDQrMIpTJiLSlMbT3yWitHZpeQSDEdD7XgI4Zh0U0MhOtJBrRBG6JOHS33c15AlHg==", 140 | "dev": true, 141 | "dependencies": { 142 | "@bevry/fs-accessible": "^2.5.0", 143 | "editions": "^6.21.0" 144 | }, 145 | "engines": { 146 | "node": ">=4" 147 | }, 148 | "funding": { 149 | "url": "https://bevry.me/fund" 150 | } 151 | }, 152 | "node_modules/@bevry/fs-unlink": { 153 | "version": "1.6.0", 154 | "resolved": "https://registry.npmjs.org/@bevry/fs-unlink/-/fs-unlink-1.6.0.tgz", 155 | "integrity": "sha512-QgBbjuhIj4Egc6Anfb9WKJnHTHFGdmznMp19vCHuaT0qEU+2bGLDxQnTbc+mjDUADGY2rXhcSHdeM3euPUE0xA==", 156 | "dev": true, 157 | "dependencies": { 158 | "@bevry/fs-accessible": "^2.5.0", 159 | "editions": "^6.21.0", 160 | "errlop": "^8.4.0" 161 | }, 162 | "engines": { 163 | "node": ">=4" 164 | }, 165 | "funding": { 166 | "url": "https://bevry.me/fund" 167 | } 168 | }, 169 | "node_modules/@bevry/fs-write": { 170 | "version": "1.6.0", 171 | "resolved": "https://registry.npmjs.org/@bevry/fs-write/-/fs-write-1.6.0.tgz", 172 | "integrity": "sha512-LldYhDchtX/RY5sg+bloJVhrfHQ/gBzL/4iPD+94zdA31P2xO69B+PJCsgOOrvhejMiPmAhSA5zsoxOGi1Q0Hw==", 173 | "dev": true, 174 | "dependencies": { 175 | "@bevry/fs-accessible": "^2.5.0", 176 | "@bevry/fs-mkdirp": "^1.6.0", 177 | "editions": "^6.21.0", 178 | "errlop": "^8.4.0" 179 | }, 180 | "engines": { 181 | "node": ">=4" 182 | }, 183 | "funding": { 184 | "url": "https://bevry.me/fund" 185 | } 186 | }, 187 | "node_modules/@bevry/github-api": { 188 | "version": "11.3.3", 189 | "resolved": "https://registry.npmjs.org/@bevry/github-api/-/github-api-11.3.3.tgz", 190 | "integrity": "sha512-sbZ1YsopkKmAG7oA9rQzpaotfAXMdx4REO8SbeSjF7mWLvcj89IGhASCWpg+CHgVlN4V6kq/T6p3fHl6BQvuvA==", 191 | "dev": true, 192 | "dependencies": { 193 | "@bevry/argument": "^1.1.0", 194 | "@bevry/fs-readable": "^2.4.0", 195 | "@bevry/json": "^2.3.0", 196 | "@bevry/list": "^2.4.0", 197 | "@bevry/wait": "^2.5.0", 198 | "@octokit/graphql": "^7.0.2", 199 | "arrange-package-json": "^5.1.0", 200 | "errlop": "^8.4.0", 201 | "fellow": "^7.1.2", 202 | "js-yaml": "^4.1.0", 203 | "native-promise-pool": "^3.27.0", 204 | "simplytyped": "^3.3.0", 205 | "trim-empty-keys": "^1.1.0" 206 | }, 207 | "bin": { 208 | "github-backers": "bin.cjs" 209 | }, 210 | "engines": { 211 | "node": ">=18" 212 | }, 213 | "funding": { 214 | "url": "https://bevry.me/fund" 215 | } 216 | }, 217 | "node_modules/@bevry/json": { 218 | "version": "2.4.0", 219 | "resolved": "https://registry.npmjs.org/@bevry/json/-/json-2.4.0.tgz", 220 | "integrity": "sha512-k1o7AwpGpwQdC798xc54eK1Tuto8rQVojJjT47TqAAr/9YPUtf08Iix7nhelqinv3M6dooABoohh389HBoeETQ==", 221 | "dev": true, 222 | "dependencies": { 223 | "@bevry/fs-read": "^1.6.0", 224 | "@bevry/fs-unlink": "^1.6.0", 225 | "@bevry/fs-write": "^1.6.0", 226 | "editions": "^6.21.0", 227 | "errlop": "^8.4.0" 228 | }, 229 | "engines": { 230 | "node": ">=4" 231 | }, 232 | "funding": { 233 | "url": "https://bevry.me/fund" 234 | } 235 | }, 236 | "node_modules/@bevry/list": { 237 | "version": "2.4.0", 238 | "resolved": "https://registry.npmjs.org/@bevry/list/-/list-2.4.0.tgz", 239 | "integrity": "sha512-epnjQ/Xi3TOPiXwRr74zZ5oAiSBoILpaeKw5rQg8qBSJh27KuiVmc04iPWpJ9f5tFesCv0dy8A4SKUob5iVTUw==", 240 | "dev": true, 241 | "dependencies": { 242 | "editions": "^6.20.0" 243 | }, 244 | "engines": { 245 | "node": ">=4" 246 | }, 247 | "funding": { 248 | "url": "https://bevry.me/fund" 249 | } 250 | }, 251 | "node_modules/@bevry/render": { 252 | "version": "1.2.0", 253 | "resolved": "https://registry.npmjs.org/@bevry/render/-/render-1.2.0.tgz", 254 | "integrity": "sha512-Hpe5ruDr0V0XiN2025fKqcTJr/qstX03uf+/XxG7s2Id9oWmYbIARQpzjQnq00thd8txYl+R5EtFDz8TO79q1Q==", 255 | "dev": true, 256 | "engines": { 257 | "node": ">=4" 258 | }, 259 | "funding": { 260 | "url": "https://bevry.me/fund" 261 | } 262 | }, 263 | "node_modules/@bevry/valid-filename": { 264 | "version": "2.6.0", 265 | "resolved": "https://registry.npmjs.org/@bevry/valid-filename/-/valid-filename-2.6.0.tgz", 266 | "integrity": "sha512-p5sl7sUGPbScN99KITIvuKWul9ICuYuXCAz5VjKoUC1fFllU1h2nB1bQYOkZNi0TLCWtk5LIdAg73fPxqgWyXw==", 267 | "dev": true, 268 | "bin": { 269 | "valid-filename": "bin.cjs" 270 | }, 271 | "engines": { 272 | "node": ">=4" 273 | }, 274 | "funding": { 275 | "url": "https://bevry.me/fund" 276 | } 277 | }, 278 | "node_modules/@bevry/wait": { 279 | "version": "2.6.0", 280 | "resolved": "https://registry.npmjs.org/@bevry/wait/-/wait-2.6.0.tgz", 281 | "integrity": "sha512-RswBYspXtm6WoyMsRbsITxqmMCIa6SJ8kZOMeN303kcD/6dda9KJbEd/Hl1Ft7GXaagr4LeGihRlQ7FvgBD2+g==", 282 | "dev": true, 283 | "engines": { 284 | "node": ">=4" 285 | }, 286 | "funding": { 287 | "url": "https://bevry.me/fund" 288 | } 289 | }, 290 | "node_modules/@octokit/endpoint": { 291 | "version": "9.0.4", 292 | "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.4.tgz", 293 | "integrity": "sha512-DWPLtr1Kz3tv8L0UvXTDP1fNwM0S+z6EJpRcvH66orY6Eld4XBMCSYsaWp4xIm61jTWxK68BrR7ibO+vSDnZqw==", 294 | "dev": true, 295 | "dependencies": { 296 | "@octokit/types": "^12.0.0", 297 | "universal-user-agent": "^6.0.0" 298 | }, 299 | "engines": { 300 | "node": ">= 18" 301 | } 302 | }, 303 | "node_modules/@octokit/graphql": { 304 | "version": "7.0.2", 305 | "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.0.2.tgz", 306 | "integrity": "sha512-OJ2iGMtj5Tg3s6RaXH22cJcxXRi7Y3EBqbHTBRq+PQAqfaS8f/236fUrWhfSn8P4jovyzqucxme7/vWSSZBX2Q==", 307 | "dev": true, 308 | "dependencies": { 309 | "@octokit/request": "^8.0.1", 310 | "@octokit/types": "^12.0.0", 311 | "universal-user-agent": "^6.0.0" 312 | }, 313 | "engines": { 314 | "node": ">= 18" 315 | } 316 | }, 317 | "node_modules/@octokit/openapi-types": { 318 | "version": "19.1.0", 319 | "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-19.1.0.tgz", 320 | "integrity": "sha512-6G+ywGClliGQwRsjvqVYpklIfa7oRPA0vyhPQG/1Feh+B+wU0vGH1JiJ5T25d3g1JZYBHzR2qefLi9x8Gt+cpw==", 321 | "dev": true 322 | }, 323 | "node_modules/@octokit/request": { 324 | "version": "8.1.6", 325 | "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.1.6.tgz", 326 | "integrity": "sha512-YhPaGml3ncZC1NfXpP3WZ7iliL1ap6tLkAp6MvbK2fTTPytzVUyUesBBogcdMm86uRYO5rHaM1xIWxigWZ17MQ==", 327 | "dev": true, 328 | "dependencies": { 329 | "@octokit/endpoint": "^9.0.0", 330 | "@octokit/request-error": "^5.0.0", 331 | "@octokit/types": "^12.0.0", 332 | "universal-user-agent": "^6.0.0" 333 | }, 334 | "engines": { 335 | "node": ">= 18" 336 | } 337 | }, 338 | "node_modules/@octokit/request-error": { 339 | "version": "5.0.1", 340 | "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.0.1.tgz", 341 | "integrity": "sha512-X7pnyTMV7MgtGmiXBwmO6M5kIPrntOXdyKZLigNfQWSEQzVxR4a4vo49vJjTWX70mPndj8KhfT4Dx+2Ng3vnBQ==", 342 | "dev": true, 343 | "dependencies": { 344 | "@octokit/types": "^12.0.0", 345 | "deprecation": "^2.0.0", 346 | "once": "^1.4.0" 347 | }, 348 | "engines": { 349 | "node": ">= 18" 350 | } 351 | }, 352 | "node_modules/@octokit/types": { 353 | "version": "12.4.0", 354 | "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.4.0.tgz", 355 | "integrity": "sha512-FLWs/AvZllw/AGVs+nJ+ELCDZZJk+kY0zMen118xhL2zD0s1etIUHm1odgjP7epxYU1ln7SZxEUWYop5bhsdgQ==", 356 | "dev": true, 357 | "dependencies": { 358 | "@octokit/openapi-types": "^19.1.0" 359 | } 360 | }, 361 | "node_modules/ambi": { 362 | "version": "3.2.0", 363 | "resolved": "https://registry.npmjs.org/ambi/-/ambi-3.2.0.tgz", 364 | "integrity": "sha512-nj5sHLPFd7u2OLmHdFs4DHt3gK6edpNw35hTRIKyI/Vd2Th5e4io50rw1lhmCdUNO2Mm4/4FkHmv6shEANAWcw==", 365 | "dev": true, 366 | "dependencies": { 367 | "editions": "^2.1.0", 368 | "typechecker": "^4.3.0" 369 | }, 370 | "engines": { 371 | "node": ">=0.8" 372 | } 373 | }, 374 | "node_modules/ambi/node_modules/editions": { 375 | "version": "2.3.1", 376 | "resolved": "https://registry.npmjs.org/editions/-/editions-2.3.1.tgz", 377 | "integrity": "sha512-ptGvkwTvGdGfC0hfhKg0MT+TRLRKGtUiWGBInxOm5pz7ssADezahjCUaYuZ8Dr+C05FW0AECIIPt4WBxVINEhA==", 378 | "dev": true, 379 | "dependencies": { 380 | "errlop": "^2.0.0", 381 | "semver": "^6.3.0" 382 | }, 383 | "engines": { 384 | "node": ">=0.8" 385 | }, 386 | "funding": { 387 | "url": "https://bevry.me/fund" 388 | } 389 | }, 390 | "node_modules/ambi/node_modules/errlop": { 391 | "version": "2.2.0", 392 | "resolved": "https://registry.npmjs.org/errlop/-/errlop-2.2.0.tgz", 393 | "integrity": "sha512-e64Qj9+4aZzjzzFpZC7p5kmm/ccCrbLhAJplhsDXQFs87XTsXwOpH4s1Io2s90Tau/8r2j9f4l/thhDevRjzxw==", 394 | "dev": true, 395 | "engines": { 396 | "node": ">=0.8" 397 | }, 398 | "funding": { 399 | "url": "https://bevry.me/fund" 400 | } 401 | }, 402 | "node_modules/ambi/node_modules/typechecker": { 403 | "version": "4.11.0", 404 | "resolved": "https://registry.npmjs.org/typechecker/-/typechecker-4.11.0.tgz", 405 | "integrity": "sha512-lz39Mc/d1UBcF/uQFL5P8L+oWdIn/stvkUgHf0tPRW4aEwGGErewNXo2Nb6We2WslWifn00rhcHbbRWRcTGhuw==", 406 | "dev": true, 407 | "dependencies": { 408 | "editions": "^2.2.0" 409 | }, 410 | "engines": { 411 | "node": ">=0.8" 412 | }, 413 | "funding": { 414 | "url": "https://bevry.me/fund" 415 | } 416 | }, 417 | "node_modules/argparse": { 418 | "version": "2.0.1", 419 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", 420 | "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", 421 | "dev": true 422 | }, 423 | "node_modules/arrange-package-json": { 424 | "version": "5.2.0", 425 | "resolved": "https://registry.npmjs.org/arrange-package-json/-/arrange-package-json-5.2.0.tgz", 426 | "integrity": "sha512-wCDmparOOlTTpR7Gr3r7XW2LJEhzDwqlV6ytBNJTOo92ErsbO6AuI8Sf6AsLvT2mv41juhl7IDOOWgfJlGb0oQ==", 427 | "dev": true, 428 | "dependencies": { 429 | "arrangekeys": "^6.7.0", 430 | "editions": "^6.21.0" 431 | }, 432 | "engines": { 433 | "node": ">=4" 434 | }, 435 | "funding": { 436 | "url": "https://bevry.me/fund" 437 | } 438 | }, 439 | "node_modules/arrangekeys": { 440 | "version": "6.7.0", 441 | "resolved": "https://registry.npmjs.org/arrangekeys/-/arrangekeys-6.7.0.tgz", 442 | "integrity": "sha512-BaB49iPe6WO7cvCgucT8o5FI6WnygDLlrGemuwdMWjIb5yVkGwdh0sT9pKeZRsNWEyPrejlu2jo5b6E8B2Hzww==", 443 | "dev": true, 444 | "engines": { 445 | "node": ">=4" 446 | }, 447 | "funding": { 448 | "url": "https://bevry.me/fund" 449 | } 450 | }, 451 | "node_modules/assert-helpers": { 452 | "version": "11.12.0", 453 | "resolved": "https://registry.npmjs.org/assert-helpers/-/assert-helpers-11.12.0.tgz", 454 | "integrity": "sha512-IpvFzGOc6M3zgZYqa+OxGZ9piO0GFtHzZl1wIR+0Wt7S4YhBabycAqG+rd/WWX+99Sv7Fd766IiJ0I2RgMN4hg==", 455 | "dev": true, 456 | "dependencies": { 457 | "@bevry/ansi": "^6.9.0", 458 | "editions": "^6.20.0", 459 | "errlop": "^8.4.0" 460 | }, 461 | "engines": { 462 | "node": ">=4" 463 | }, 464 | "funding": { 465 | "url": "https://bevry.me/fund" 466 | } 467 | }, 468 | "node_modules/badges": { 469 | "version": "4.40.0", 470 | "resolved": "https://registry.npmjs.org/badges/-/badges-4.40.0.tgz", 471 | "integrity": "sha512-PjeBM7oVzkcLDv62aQZZGOB1NPOzPRAoJr6cxDRFfeYxjK7tSOtNkOvcWxxAUZLpXTS3G6K+QmwyrEhLfbWNoA==", 472 | "dev": true, 473 | "engines": { 474 | "node": ">=10" 475 | }, 476 | "funding": { 477 | "url": "https://bevry.me/fund" 478 | } 479 | }, 480 | "node_modules/balanced-match": { 481 | "version": "1.0.2", 482 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 483 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", 484 | "dev": true 485 | }, 486 | "node_modules/brace-expansion": { 487 | "version": "1.1.11", 488 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 489 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 490 | "dev": true, 491 | "dependencies": { 492 | "balanced-match": "^1.0.0", 493 | "concat-map": "0.0.1" 494 | } 495 | }, 496 | "node_modules/caterpillar": { 497 | "version": "8.2.0", 498 | "resolved": "https://registry.npmjs.org/caterpillar/-/caterpillar-8.2.0.tgz", 499 | "integrity": "sha512-c7qv+EwyVIGjDb4XG+jen7oQ/J1MEkEmYeIkmFIGjnfDrlNaj+nOHwGldjmy38iQBHBuKKLj2u15Agv0rTZyPw==", 500 | "dev": true, 501 | "dependencies": { 502 | "@bevry/ansi": "^6.9.0", 503 | "editions": "^6.21.0", 504 | "get-current-line": "^7.3.0", 505 | "rfc-log-levels": "^4.2.0" 506 | }, 507 | "engines": { 508 | "node": ">=4" 509 | }, 510 | "funding": { 511 | "url": "https://bevry.me/fund" 512 | } 513 | }, 514 | "node_modules/coffeelint": { 515 | "version": "2.1.0", 516 | "resolved": "https://registry.npmjs.org/coffeelint/-/coffeelint-2.1.0.tgz", 517 | "integrity": "sha512-NrIRAGccExoRK+NtM3uz1DHZEk3woAVp92I+BBhUJDGlN0raMSHRc0/d77MLcxr1z+OQ5YiOLINPEA/JyG2zyA==", 518 | "dev": true, 519 | "dependencies": { 520 | "coffeescript": "^2.1.0", 521 | "glob": "^7.0.6", 522 | "ignore": "^3.0.9", 523 | "optimist": "^0.6.1", 524 | "resolve": "^0.6.3", 525 | "strip-json-comments": "^1.0.2" 526 | }, 527 | "bin": { 528 | "coffeelint": "bin/coffeelint" 529 | }, 530 | "engines": { 531 | "node": ">=6.9.1", 532 | "npm": ">=1.3.7" 533 | } 534 | }, 535 | "node_modules/coffeescript": { 536 | "version": "2.7.0", 537 | "resolved": "https://registry.npmjs.org/coffeescript/-/coffeescript-2.7.0.tgz", 538 | "integrity": "sha512-hzWp6TUE2d/jCcN67LrW1eh5b/rSDKQK6oD6VMLlggYVUUFexgTH9z3dNYihzX4RMhze5FTUsUmOXViJKFQR/A==", 539 | "dev": true, 540 | "bin": { 541 | "cake": "bin/cake", 542 | "coffee": "bin/coffee" 543 | }, 544 | "engines": { 545 | "node": ">=6" 546 | } 547 | }, 548 | "node_modules/concat-map": { 549 | "version": "0.0.1", 550 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 551 | "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", 552 | "dev": true 553 | }, 554 | "node_modules/cson-parser": { 555 | "version": "4.0.9", 556 | "resolved": "https://registry.npmjs.org/cson-parser/-/cson-parser-4.0.9.tgz", 557 | "integrity": "sha512-I79SAcCYquWnEfXYj8hBqOOWKj6eH6zX1hhX3yqmS4K3bYp7jME3UFpHPzu3rUew0oyfc0s8T6IlWGXRAheHag==", 558 | "dependencies": { 559 | "coffeescript": "1.12.7" 560 | }, 561 | "engines": { 562 | "node": ">=10.13" 563 | } 564 | }, 565 | "node_modules/cson-parser/node_modules/coffeescript": { 566 | "version": "1.12.7", 567 | "resolved": "https://registry.npmjs.org/coffeescript/-/coffeescript-1.12.7.tgz", 568 | "integrity": "sha512-pLXHFxQMPklVoEekowk8b3erNynC+DVJzChxS/LCBBgR6/8AJkHivkm//zbowcfc7BTCAjryuhx6gPqPRfsFoA==", 569 | "bin": { 570 | "cake": "bin/cake", 571 | "coffee": "bin/coffee" 572 | }, 573 | "engines": { 574 | "node": ">=0.8.0" 575 | } 576 | }, 577 | "node_modules/deprecation": { 578 | "version": "2.3.1", 579 | "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", 580 | "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", 581 | "dev": true 582 | }, 583 | "node_modules/eachr": { 584 | "version": "7.4.0", 585 | "resolved": "https://registry.npmjs.org/eachr/-/eachr-7.4.0.tgz", 586 | "integrity": "sha512-d6v/ERRrwxZ5oNHJz2Z5Oouge0Xc3rFxeaGNHjAhTDUCkLhy8t583ieH9/Qop1UNDTcZXOSEs8dqawmbHaEEkA==", 587 | "dependencies": { 588 | "editions": "^6.21.0", 589 | "typechecker": "^9.3.0" 590 | }, 591 | "engines": { 592 | "node": ">=4" 593 | }, 594 | "funding": { 595 | "url": "https://bevry.me/fund" 596 | } 597 | }, 598 | "node_modules/editions": { 599 | "version": "6.21.0", 600 | "resolved": "https://registry.npmjs.org/editions/-/editions-6.21.0.tgz", 601 | "integrity": "sha512-ofkXJtn7z0urokN62DI3SBo/5xAtF0rR7tn+S/bSYV79Ka8pTajIIl+fFQ1q88DQEImymmo97M4azY3WX/nUdg==", 602 | "dependencies": { 603 | "version-range": "^4.13.0" 604 | }, 605 | "engines": { 606 | "node": ">=4" 607 | }, 608 | "funding": { 609 | "url": "https://bevry.me/fund" 610 | } 611 | }, 612 | "node_modules/errlop": { 613 | "version": "8.4.0", 614 | "resolved": "https://registry.npmjs.org/errlop/-/errlop-8.4.0.tgz", 615 | "integrity": "sha512-uTI5IgHMfsuBw9t/NWnKGKGbkMxMfDLceci9Um8Qxe33WqZeBk3IX7ndOBT1Bpo+RRyDBI67KOOb3DYPJwoqyg==", 616 | "dev": true, 617 | "dependencies": { 618 | "editions": "^6.20.0" 619 | }, 620 | "engines": { 621 | "node": ">=4" 622 | }, 623 | "funding": { 624 | "url": "https://bevry.me/fund" 625 | } 626 | }, 627 | "node_modules/event-emitter-grouped": { 628 | "version": "6.6.0", 629 | "resolved": "https://registry.npmjs.org/event-emitter-grouped/-/event-emitter-grouped-6.6.0.tgz", 630 | "integrity": "sha512-oZQp5T5rf+2MzGN4Rwgl4jEp9rshFd7NuXHEizh+7sMR+7tPzKQYo7eUqpKeqZa8wUbc/9lnz/Vd/TYHP/hnIQ==", 631 | "dev": true, 632 | "dependencies": { 633 | "editions": "^6.21.0", 634 | "taskgroup": "^9.7.0", 635 | "unbounded": "^6.3.1" 636 | }, 637 | "engines": { 638 | "node": ">=4" 639 | }, 640 | "funding": { 641 | "url": "https://bevry.me/fund" 642 | } 643 | }, 644 | "node_modules/extendr": { 645 | "version": "7.9.0", 646 | "resolved": "https://registry.npmjs.org/extendr/-/extendr-7.9.0.tgz", 647 | "integrity": "sha512-+sSXw36D1GJH7KlmxrW6r9Anav7/55MddwmyJ8n+At5doRnsWiSCPFgu8E/Pw1Hiky9Cql5e9CDoIGe/QZ3hZA==", 648 | "dev": true, 649 | "dependencies": { 650 | "editions": "^6.21.0", 651 | "typechecker": "^9.3.0" 652 | }, 653 | "engines": { 654 | "node": ">=4" 655 | }, 656 | "funding": { 657 | "url": "https://bevry.me/fund" 658 | } 659 | }, 660 | "node_modules/extract-opts": { 661 | "version": "5.8.0", 662 | "resolved": "https://registry.npmjs.org/extract-opts/-/extract-opts-5.8.0.tgz", 663 | "integrity": "sha512-kaF77bAeRRDW0mtfP1VhNdapxeJaDO82hG+mkfE8ZJh/FFJKDuCUwzgnLwdoI3PqAro6WBwNOhhieDDuwwzsng==", 664 | "dependencies": { 665 | "eachr": "^7.4.0", 666 | "editions": "^6.21.0", 667 | "typechecker": "^9.3.0" 668 | }, 669 | "engines": { 670 | "node": ">=4" 671 | }, 672 | "funding": { 673 | "url": "https://bevry.me/fund" 674 | } 675 | }, 676 | "node_modules/fdir": { 677 | "version": "6.1.1", 678 | "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.1.1.tgz", 679 | "integrity": "sha512-QfKBVg453Dyn3mr0Q0O+Tkr1r79lOTAKSi9f/Ot4+qVEwxWhav2Z+SudrG9vQjM2aYRMQQZ2/Q1zdA8ACM1pDg==", 680 | "dev": true, 681 | "peerDependencies": { 682 | "picomatch": "3.x" 683 | }, 684 | "peerDependenciesMeta": { 685 | "picomatch": { 686 | "optional": true 687 | } 688 | } 689 | }, 690 | "node_modules/fellow": { 691 | "version": "7.1.2", 692 | "resolved": "https://registry.npmjs.org/fellow/-/fellow-7.1.2.tgz", 693 | "integrity": "sha512-mTYWF4+UPHmT9in8E42V90o64s+HDQwYXB3M/SwqAm7apBV8sESAVnwPC8/d9G+VnQFGwHRTFsCxHrAJi+BNqg==", 694 | "dev": true, 695 | "dependencies": { 696 | "@bevry/render": "^1.1.0", 697 | "editions": "^6.21.0" 698 | }, 699 | "engines": { 700 | "node": ">=10" 701 | }, 702 | "funding": { 703 | "url": "https://bevry.me/fund" 704 | } 705 | }, 706 | "node_modules/fs.realpath": { 707 | "version": "1.0.0", 708 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 709 | "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", 710 | "dev": true 711 | }, 712 | "node_modules/get-current-line": { 713 | "version": "7.3.0", 714 | "resolved": "https://registry.npmjs.org/get-current-line/-/get-current-line-7.3.0.tgz", 715 | "integrity": "sha512-c05xljyfL59+gPprXL2MC5WuDeJ40MDWUXADYTm8Ma37yaDhKUuk72tWsAI3crcuulWUtR5ml98jgYQKG/M0Lg==", 716 | "dev": true, 717 | "dependencies": { 718 | "editions": "^6.20.0" 719 | }, 720 | "engines": { 721 | "node": ">=4" 722 | }, 723 | "funding": { 724 | "url": "https://bevry.me/fund" 725 | } 726 | }, 727 | "node_modules/glob": { 728 | "version": "7.2.3", 729 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", 730 | "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", 731 | "dev": true, 732 | "dependencies": { 733 | "fs.realpath": "^1.0.0", 734 | "inflight": "^1.0.4", 735 | "inherits": "2", 736 | "minimatch": "^3.1.1", 737 | "once": "^1.3.0", 738 | "path-is-absolute": "^1.0.0" 739 | }, 740 | "engines": { 741 | "node": "*" 742 | }, 743 | "funding": { 744 | "url": "https://github.com/sponsors/isaacs" 745 | } 746 | }, 747 | "node_modules/graceful-fs": { 748 | "version": "4.2.11", 749 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", 750 | "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" 751 | }, 752 | "node_modules/ignore": { 753 | "version": "3.3.10", 754 | "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", 755 | "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", 756 | "dev": true 757 | }, 758 | "node_modules/inflight": { 759 | "version": "1.0.6", 760 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 761 | "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", 762 | "dev": true, 763 | "dependencies": { 764 | "once": "^1.3.0", 765 | "wrappy": "1" 766 | } 767 | }, 768 | "node_modules/inherits": { 769 | "version": "2.0.4", 770 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 771 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 772 | "dev": true 773 | }, 774 | "node_modules/js-yaml": { 775 | "version": "4.1.0", 776 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", 777 | "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", 778 | "dev": true, 779 | "dependencies": { 780 | "argparse": "^2.0.1" 781 | }, 782 | "bin": { 783 | "js-yaml": "bin/js-yaml.js" 784 | } 785 | }, 786 | "node_modules/kava": { 787 | "version": "7.8.0", 788 | "resolved": "https://registry.npmjs.org/kava/-/kava-7.8.0.tgz", 789 | "integrity": "sha512-sFi8RebKrccbD3r82UTMQEc0G23yH4jFleUpd2v0opEsocRlM81PT7hKzbHvbA8+hCtBY/5/FT4qbq9ntvymjg==", 790 | "dev": true, 791 | "dependencies": { 792 | "editions": "^6.21.0", 793 | "event-emitter-grouped": "^6.6.0", 794 | "taskgroup": "^9.7.0" 795 | }, 796 | "engines": { 797 | "node": ">=4" 798 | }, 799 | "funding": { 800 | "url": "https://bevry.me/fund" 801 | } 802 | }, 803 | "node_modules/minimatch": { 804 | "version": "3.1.2", 805 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", 806 | "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", 807 | "dev": true, 808 | "dependencies": { 809 | "brace-expansion": "^1.1.7" 810 | }, 811 | "engines": { 812 | "node": "*" 813 | } 814 | }, 815 | "node_modules/minimist": { 816 | "version": "0.0.10", 817 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", 818 | "integrity": "sha512-iotkTvxc+TwOm5Ieim8VnSNvCDjCK9S8G3scJ50ZthspSxa7jx50jkhYduuAtAjvfDUwSgOwf8+If99AlOEhyw==", 819 | "dev": true 820 | }, 821 | "node_modules/native-promise-pool": { 822 | "version": "3.27.0", 823 | "resolved": "https://registry.npmjs.org/native-promise-pool/-/native-promise-pool-3.27.0.tgz", 824 | "integrity": "sha512-QvYRM010F82Ygod3TgsRkeDAKm7PP6z0nXFcqzPxP9jfI3KxIWLMUUTcT/WqWlxt0PJPwqYv4qJMMhkznNCXXw==", 825 | "dev": true, 826 | "dependencies": { 827 | "editions": "^6.20.0" 828 | }, 829 | "engines": { 830 | "node": ">=10" 831 | }, 832 | "funding": { 833 | "url": "https://bevry.me/fund" 834 | } 835 | }, 836 | "node_modules/once": { 837 | "version": "1.4.0", 838 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 839 | "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", 840 | "dev": true, 841 | "dependencies": { 842 | "wrappy": "1" 843 | } 844 | }, 845 | "node_modules/optimist": { 846 | "version": "0.6.1", 847 | "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", 848 | "integrity": "sha512-snN4O4TkigujZphWLN0E//nQmm7790RYaE53DdL7ZYwee2D8DDo9/EyYiKUfN3rneWUjhJnueija3G9I2i0h3g==", 849 | "dev": true, 850 | "dependencies": { 851 | "minimist": "~0.0.1", 852 | "wordwrap": "~0.0.2" 853 | } 854 | }, 855 | "node_modules/path-is-absolute": { 856 | "version": "1.0.1", 857 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 858 | "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", 859 | "dev": true, 860 | "engines": { 861 | "node": ">=0.10.0" 862 | } 863 | }, 864 | "node_modules/projectz": { 865 | "version": "4.1.1", 866 | "resolved": "https://registry.npmjs.org/projectz/-/projectz-4.1.1.tgz", 867 | "integrity": "sha512-yI22S7x2/HMT/Vxx81/WT2slcKzDLUMU26YnEqkSeRtfGhGkmpHzbHAnD/8b+7t8qCV+WrCPhaeb7VaI+b6AVQ==", 868 | "dev": true, 869 | "dependencies": { 870 | "@bevry/argument": "^1.1.0", 871 | "@bevry/fs-list": "^2.5.0", 872 | "@bevry/fs-read": "^1.5.0", 873 | "@bevry/fs-write": "^1.5.0", 874 | "@bevry/github-api": "^11.3.1", 875 | "@bevry/json": "^2.3.0", 876 | "@bevry/render": "^1.1.0", 877 | "arrange-package-json": "^5.1.0", 878 | "badges": "^4.39.0", 879 | "caterpillar": "^8.1.0", 880 | "spdx-expression-parse": "^4.0.0", 881 | "spdx-license-list": "^6.8.0", 882 | "trim-empty-keys": "^1.1.0", 883 | "typechecker": "^9.3.0" 884 | }, 885 | "bin": { 886 | "projectz": "bin.cjs" 887 | }, 888 | "engines": { 889 | "node": ">=20" 890 | }, 891 | "funding": { 892 | "url": "https://bevry.me/fund" 893 | } 894 | }, 895 | "node_modules/requirefresh": { 896 | "version": "5.13.0", 897 | "resolved": "https://registry.npmjs.org/requirefresh/-/requirefresh-5.13.0.tgz", 898 | "integrity": "sha512-v3BuU/AAKjDqgIig1xyekcBHtujCAghuFTOQ7YNAngEKtTksSS1vT9Abt1ilbmQFAD4ChHHGJ3JSNbqvEOIxkQ==", 899 | "engines": { 900 | "node": ">=4" 901 | }, 902 | "funding": { 903 | "url": "https://bevry.me/fund" 904 | } 905 | }, 906 | "node_modules/resolve": { 907 | "version": "0.6.3", 908 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-0.6.3.tgz", 909 | "integrity": "sha512-UHBY3viPlJKf85YijDUcikKX6tmF4SokIDp518ZDVT92JNDcG5uKIthaT/owt3Sar0lwtOafsQuwrg22/v2Dwg==", 910 | "dev": true 911 | }, 912 | "node_modules/rfc-log-levels": { 913 | "version": "4.2.0", 914 | "resolved": "https://registry.npmjs.org/rfc-log-levels/-/rfc-log-levels-4.2.0.tgz", 915 | "integrity": "sha512-CZ2+u5Hol5k+bfIrTkRzWGZfTSHvu/aKDtaJsBWYjUunIgOoAUAxJV6m4EnX2ctNhDuYB5ascFRys5ccKO1afQ==", 916 | "dev": true, 917 | "dependencies": { 918 | "editions": "^6.20.0" 919 | }, 920 | "engines": { 921 | "node": ">=4" 922 | }, 923 | "funding": { 924 | "url": "https://bevry.me/fund" 925 | } 926 | }, 927 | "node_modules/safefs": { 928 | "version": "8.9.0", 929 | "resolved": "https://registry.npmjs.org/safefs/-/safefs-8.9.0.tgz", 930 | "integrity": "sha512-kFEWbz7Uty9cmAZpb7caucQWQG/6XhTWLQyamwxjYqLXqx+EUDHcGmsxbIC2dotbTh97sAXYuYBD1mWNV5WG9Q==", 931 | "dependencies": { 932 | "editions": "^6.21.0", 933 | "graceful-fs": "^4.2.11", 934 | "version-compare": "^3.10.0" 935 | }, 936 | "engines": { 937 | "node": ">=4" 938 | }, 939 | "funding": { 940 | "url": "https://bevry.me/fund" 941 | } 942 | }, 943 | "node_modules/safeps": { 944 | "version": "11.6.0", 945 | "resolved": "https://registry.npmjs.org/safeps/-/safeps-11.6.0.tgz", 946 | "integrity": "sha512-hWA2iaDBetwKvuxlA10ziGIbQMwM0HOCy++ckqoOTX7VBg03KsIvLf3Y5CBANlUi6ED4FHEGrPd3zGAlFfhEXQ==", 947 | "dev": true, 948 | "dependencies": { 949 | "editions": "^6.21.0", 950 | "extract-opts": "^5.8.0", 951 | "safefs": "^8.9.0", 952 | "taskgroup": "^9.6.0", 953 | "typechecker": "^9.3.0" 954 | }, 955 | "engines": { 956 | "node": ">=4" 957 | }, 958 | "funding": { 959 | "url": "https://bevry.me/fund" 960 | } 961 | }, 962 | "node_modules/semver": { 963 | "version": "6.3.1", 964 | "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", 965 | "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", 966 | "dev": true, 967 | "bin": { 968 | "semver": "bin/semver.js" 969 | } 970 | }, 971 | "node_modules/simplytyped": { 972 | "version": "3.3.0", 973 | "resolved": "https://registry.npmjs.org/simplytyped/-/simplytyped-3.3.0.tgz", 974 | "integrity": "sha512-mz4RaNdKTZiaKXgi6P1k/cdsxV3gz+y1Wh2NXHWD40dExktLh4Xx/h6MFakmQWODZHj/2rKe59acacpL74ZhQA==", 975 | "dev": true, 976 | "peerDependencies": { 977 | "typescript": ">=2.8.0" 978 | } 979 | }, 980 | "node_modules/spdx-exceptions": { 981 | "version": "2.3.0", 982 | "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", 983 | "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", 984 | "dev": true 985 | }, 986 | "node_modules/spdx-expression-parse": { 987 | "version": "4.0.0", 988 | "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz", 989 | "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==", 990 | "dev": true, 991 | "dependencies": { 992 | "spdx-exceptions": "^2.1.0", 993 | "spdx-license-ids": "^3.0.0" 994 | } 995 | }, 996 | "node_modules/spdx-license-ids": { 997 | "version": "3.0.16", 998 | "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.16.tgz", 999 | "integrity": "sha512-eWN+LnM3GR6gPu35WxNgbGl8rmY1AEmoMDvL/QD6zYmPWgywxWqJWNdLGT+ke8dKNWrcYgYjPpG5gbTfghP8rw==", 1000 | "dev": true 1001 | }, 1002 | "node_modules/spdx-license-list": { 1003 | "version": "6.8.0", 1004 | "resolved": "https://registry.npmjs.org/spdx-license-list/-/spdx-license-list-6.8.0.tgz", 1005 | "integrity": "sha512-5UdM7r9yJ1EvsPQZWfa41AZjLQngl9iMMysm9XBW7Lqhq7aF8cllfqjS+rFCHB8FFMGSM0yFWue2LUV9mR0QzQ==", 1006 | "dev": true, 1007 | "engines": { 1008 | "node": ">=8" 1009 | }, 1010 | "funding": { 1011 | "url": "https://github.com/sponsors/sindresorhus" 1012 | } 1013 | }, 1014 | "node_modules/strip-json-comments": { 1015 | "version": "1.0.4", 1016 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", 1017 | "integrity": "sha512-AOPG8EBc5wAikaG1/7uFCNFJwnKOuQwFTpYBdTW6OvWHeZBQBrAA/amefHGrEiOnCPcLFZK6FUPtWVKpQVIRgg==", 1018 | "dev": true, 1019 | "bin": { 1020 | "strip-json-comments": "cli.js" 1021 | }, 1022 | "engines": { 1023 | "node": ">=0.8.0" 1024 | } 1025 | }, 1026 | "node_modules/taskgroup": { 1027 | "version": "9.7.0", 1028 | "resolved": "https://registry.npmjs.org/taskgroup/-/taskgroup-9.7.0.tgz", 1029 | "integrity": "sha512-BN7NhPCGVNOSvbNx51H/nbvrhddMbm3wTU9lqlq0avwTSDPxkpS8cW16mbi8Pa8cNisCplU+est9EQoi2B2PKw==", 1030 | "dev": true, 1031 | "dependencies": { 1032 | "ambi": "3.2.0", 1033 | "eachr": "^7.4.0", 1034 | "editions": "^6.21.0", 1035 | "extendr": "^7.9.0", 1036 | "unbounded": "^6.3.1" 1037 | }, 1038 | "engines": { 1039 | "node": ">=4" 1040 | }, 1041 | "funding": { 1042 | "url": "https://bevry.me/fund" 1043 | } 1044 | }, 1045 | "node_modules/trim-empty-keys": { 1046 | "version": "1.1.0", 1047 | "resolved": "https://registry.npmjs.org/trim-empty-keys/-/trim-empty-keys-1.1.0.tgz", 1048 | "integrity": "sha512-LxZzCVSQ6dTiVOYiBDcY8CTkzOYzdU8JI5S4sy5/LHaneGwHRG5jzsryOhKAqlGkEu4IaMQYgpJ2J9Lq8ejzkg==", 1049 | "dev": true, 1050 | "dependencies": { 1051 | "typechecker": "^9.3.0" 1052 | }, 1053 | "engines": { 1054 | "node": ">=8" 1055 | }, 1056 | "funding": { 1057 | "url": "https://bevry.me/fund" 1058 | } 1059 | }, 1060 | "node_modules/typechecker": { 1061 | "version": "9.3.0", 1062 | "resolved": "https://registry.npmjs.org/typechecker/-/typechecker-9.3.0.tgz", 1063 | "integrity": "sha512-7NKr0EkLaL5fkYE56DPwqgQx1FjepvDRZ64trUgb1NgeFqLkaZThI2L33vFJzN4plVyAN5zWcov57QcZIU3bjg==", 1064 | "dependencies": { 1065 | "editions": "^6.20.0" 1066 | }, 1067 | "engines": { 1068 | "node": ">=4" 1069 | }, 1070 | "funding": { 1071 | "url": "https://bevry.me/fund" 1072 | } 1073 | }, 1074 | "node_modules/typescript": { 1075 | "version": "5.3.3", 1076 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", 1077 | "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", 1078 | "dev": true, 1079 | "peer": true, 1080 | "bin": { 1081 | "tsc": "bin/tsc", 1082 | "tsserver": "bin/tsserver" 1083 | }, 1084 | "engines": { 1085 | "node": ">=14.17" 1086 | } 1087 | }, 1088 | "node_modules/unbounded": { 1089 | "version": "6.3.1", 1090 | "resolved": "https://registry.npmjs.org/unbounded/-/unbounded-6.3.1.tgz", 1091 | "integrity": "sha512-I02/dMCiMXSc+Hqi7U7fAcT9/XnQ0GgWSAqRfl2/7TRkrO7yeZw+0haDh5OpPljYjaRMzWODkMwpbMkCi47z8g==", 1092 | "dev": true, 1093 | "dependencies": { 1094 | "editions": "^6.21.0" 1095 | }, 1096 | "engines": { 1097 | "node": ">=4" 1098 | }, 1099 | "funding": { 1100 | "url": "https://bevry.me/fund" 1101 | } 1102 | }, 1103 | "node_modules/universal-user-agent": { 1104 | "version": "6.0.1", 1105 | "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", 1106 | "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==", 1107 | "dev": true 1108 | }, 1109 | "node_modules/valid-directory": { 1110 | "version": "4.8.0", 1111 | "resolved": "https://registry.npmjs.org/valid-directory/-/valid-directory-4.8.0.tgz", 1112 | "integrity": "sha512-71SQWCDI/hk+gTQ2/u531ldpa5Qecl9U2oODwU5ubTGj+BE3GqdFdkLM8/OZa0QCsPYChZWl+62h9TZoZ4j3Wg==", 1113 | "dev": true, 1114 | "dependencies": { 1115 | "@bevry/valid-filename": "^2.5.0", 1116 | "fdir": "^6.1.1" 1117 | }, 1118 | "bin": { 1119 | "valid-directory": "bin.cjs" 1120 | }, 1121 | "engines": { 1122 | "node": ">=18" 1123 | }, 1124 | "funding": { 1125 | "url": "https://bevry.me/fund" 1126 | } 1127 | }, 1128 | "node_modules/version-compare": { 1129 | "version": "3.10.0", 1130 | "resolved": "https://registry.npmjs.org/version-compare/-/version-compare-3.10.0.tgz", 1131 | "integrity": "sha512-/CuLY4D2++5aAq4L0XDsKbrpbruhqSrCrdK/93ClqqgvwAtq6819M7veqjmSNXCro/xO1fZY47TPaNHEfzQywA==", 1132 | "dependencies": { 1133 | "editions": "^6.20.0" 1134 | }, 1135 | "engines": { 1136 | "node": ">=4" 1137 | }, 1138 | "funding": { 1139 | "url": "https://bevry.me/fund" 1140 | } 1141 | }, 1142 | "node_modules/version-range": { 1143 | "version": "4.13.0", 1144 | "resolved": "https://registry.npmjs.org/version-range/-/version-range-4.13.0.tgz", 1145 | "integrity": "sha512-/DLT9Gj8/MVd0OGX59AJuD0n3oGjiB2PB99M0kH7+0PH/GS3GiY/fNU8ptkBHrloKKg6KTAlhV5leXG9EWiggg==", 1146 | "engines": { 1147 | "node": ">=4" 1148 | }, 1149 | "funding": { 1150 | "url": "https://bevry.me/fund" 1151 | } 1152 | }, 1153 | "node_modules/wordwrap": { 1154 | "version": "0.0.3", 1155 | "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", 1156 | "integrity": "sha512-1tMA907+V4QmxV7dbRvb4/8MaRALK6q9Abid3ndMYnbyo8piisCmeONVqVSXqQA3KaP4SLt5b7ud6E2sqP8TFw==", 1157 | "dev": true, 1158 | "engines": { 1159 | "node": ">=0.4.0" 1160 | } 1161 | }, 1162 | "node_modules/wrappy": { 1163 | "version": "1.0.2", 1164 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 1165 | "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", 1166 | "dev": true 1167 | } 1168 | } 1169 | } 1170 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "CSON", 3 | "name": "cson", 4 | "version": "8.4.0", 5 | "license": "Artistic-2.0", 6 | "description": "CoffeeScript-Object-Notation Parser. Same as JSON but for CoffeeScript objects.", 7 | "homepage": "https://github.com/bevry/cson", 8 | "funding": "https://bevry.me/fund", 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/bevry/cson.git" 12 | }, 13 | "bugs": { 14 | "url": "https://github.com/bevry/cson/issues" 15 | }, 16 | "keywords": [ 17 | "coffeescript", 18 | "cson", 19 | "esnext", 20 | "javascript", 21 | "node", 22 | "parse", 23 | "stringify" 24 | ], 25 | "badges": { 26 | "list": [ 27 | "githubworkflow", 28 | "npmversion", 29 | "npmdownloads", 30 | "---", 31 | "githubsponsors", 32 | "thanksdev", 33 | "patreon", 34 | "liberapay", 35 | "buymeacoffee", 36 | "opencollective", 37 | "crypto", 38 | "paypal", 39 | "---", 40 | "discord", 41 | "twitch" 42 | ], 43 | "config": { 44 | "githubWorkflow": "bevry", 45 | "githubSponsorsUsername": "balupton", 46 | "thanksdevGithubUsername": "bevry", 47 | "buymeacoffeeUsername": "balupton", 48 | "cryptoURL": "https://bevry.me/crypto", 49 | "flattrUsername": "balupton", 50 | "liberapayUsername": "bevry", 51 | "opencollectiveUsername": "bevry", 52 | "patreonUsername": "bevry", 53 | "paypalURL": "https://bevry.me/paypal", 54 | "wishlistURL": "https://bevry.me/wishlist", 55 | "discordServerID": "1147436445783560193", 56 | "discordServerInvite": "nQuXddV7VP", 57 | "twitchUsername": "balupton", 58 | "githubUsername": "bevry", 59 | "githubRepository": "cson", 60 | "githubSlug": "bevry/cson", 61 | "npmPackageName": "cson" 62 | } 63 | }, 64 | "author": "Benjamin Lupton (https://balupton.com) (https://github.com/balupton)", 65 | "authors": [ 66 | "Benjamin Lupton (https://balupton.com) (https://github.com/balupton): Accelerating collaborative wisdom." 67 | ], 68 | "maintainers": [ 69 | "Benjamin Lupton (https://balupton.com) (https://github.com/balupton): Accelerating collaborative wisdom." 70 | ], 71 | "contributors": [ 72 | "Attila Oláh (https://attilaolah.eu) (https://github.com/attilaolah)", 73 | "Attila Oláh (https://attilaolah.eu)", 74 | "Benjamin Lupton (https://balupton.com) (https://github.com/balupton)", 75 | "Claudius Nicolae (https://github.com/clyfe)", 76 | "evinugur (https://github.com/evinugur)", 77 | "Jason Karns (https://jasonkarns.com) (https://github.com/jasonkarns)", 78 | "Joël Perras (https://nerderati.com) (https://github.com/jperras)", 79 | "Linus G Thiel (https://yesbabyyes.se) (https://github.com/linus)", 80 | "Rob Loach (https://robloach.net) (https://github.com/RobLoach)", 81 | "Ryan LeFevre (https://github.com/meltingice)", 82 | "Tushar Kant (https://github.com/nanuclickity)", 83 | "Zearin (https://github.com/Zearin)", 84 | "ZHANG Cheng (https://github.com/zhangcheng)" 85 | ], 86 | "sponsors": [ 87 | "Andrew Nesbitt (https://nesbitt.io) (https://github.com/andrew): Software engineer and researcher", 88 | "Balsa (https://balsa.com) (https://github.com/balsa): We're Balsa, and we're building tools for builders.", 89 | "Codecov (https://codecov.io) (https://github.com/codecov): Empower developers with tools to improve code quality and testing.", 90 | "Poonacha Medappa (https://poonachamedappa.com) (https://github.com/km-Poonacha)", 91 | "Rob Morris (https://github.com/Rob-Morris)", 92 | "Sentry (https://sentry.io) (https://github.com/getsentry): Real-time crash reporting for your web apps, mobile apps, and games.", 93 | "Syntax (https://syntax.fm) (https://github.com/syntaxfm): Syntax Podcast" 94 | ], 95 | "donors": [ 96 | "Andrew Nesbitt (https://nesbitt.io) (https://github.com/andrew)", 97 | "Armen Mkrtchian (https://mogoni.dev) (https://github.com/Armenm)", 98 | "Balsa (https://balsa.com) (https://github.com/balsa)", 99 | "Chad (https://opencollective.com/chad8)", 100 | "Codecov (https://codecov.io) (https://github.com/codecov)", 101 | "dr.dimitru (https://veliovgroup.com) (https://github.com/dr-dimitru)", 102 | "Elliott Ditman (https://elliottditman.com) (https://github.com/elliottditman)", 103 | "entroniq (https://gitlab.com/entroniq) (https://thanks.dev/d/gl/entroniq)", 104 | "GitHub (https://github.com/about) (https://github.com/github)", 105 | "Hunter Beast (https://cryptoquick.com) (https://github.com/cryptoquick)", 106 | "Jean-Luc Geering (https://github.com/jlgeering) (https://opencollective.com/jlgeering) (https://twitter.com/jlgeering)", 107 | "Michael Duane Mooring (https://mdm.cc) (https://github.com/mikeumus) (https://opencollective.com/mikeumus) (https://twitter.com/mikeumus)", 108 | "Michael Harry Scepaniak (https://michaelscepaniak.com) (https://github.com/hispanic)", 109 | "Mohammed Shah (https://github.com/smashah) (https://thanks.dev/d/gh/smashah) (https://twitter.com/smashah)", 110 | "Mr. Henry (https://mrhenry.be) (https://github.com/mrhenry)", 111 | "Nermal (https://arjunaditya.vercel.app) (https://github.com/nermalcat69)", 112 | "Pleo (https://pleo.io) (https://github.com/pleo-io)", 113 | "Poonacha Medappa (https://poonachamedappa.com) (https://github.com/km-Poonacha)", 114 | "Rob Morris (https://github.com/Rob-Morris)", 115 | "Robert de Forest (https://github.com/rdeforest)", 116 | "Sentry (https://sentry.io) (https://github.com/getsentry)", 117 | "ServieJS (https://github.com/serviejs) (https://thanks.dev/d/gh/serviejs)", 118 | "Skunk Team (https://skunk.team) (https://github.com/skunkteam)", 119 | "Syntax (https://syntax.fm) (https://github.com/syntaxfm)", 120 | "WriterJohnBuck (https://github.com/WriterJohnBuck)" 121 | ], 122 | "engines": { 123 | "node": ">=6" 124 | }, 125 | "editions": [ 126 | { 127 | "description": "CoffeeScript source code with Require for modules", 128 | "directory": "source", 129 | "entry": "index.coffee", 130 | "tags": [ 131 | "source", 132 | "coffeescript", 133 | "require" 134 | ], 135 | "engines": false 136 | }, 137 | { 138 | "description": "CoffeeScript compiled for Node.js 6 || 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21 with Require for modules", 139 | "directory": "edition-esnext", 140 | "entry": "index.js", 141 | "tags": [ 142 | "compiled", 143 | "javascript", 144 | "esnext", 145 | "require" 146 | ], 147 | "engines": { 148 | "node": "6 || 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21" 149 | } 150 | } 151 | ], 152 | "bin": { 153 | "cson": "bin.cjs", 154 | "cson2json": "bin.cjs", 155 | "json2cson": "bin.cjs" 156 | }, 157 | "type": "commonjs", 158 | "main": "edition-esnext/index.js", 159 | "dependencies": { 160 | "cson-parser": "^4.0.9", 161 | "extract-opts": "^5.8.0", 162 | "requirefresh": "^5.13.0", 163 | "safefs": "^8.9.0" 164 | }, 165 | "devDependencies": { 166 | "assert-helpers": "^11.12.0", 167 | "coffeelint": "^2.1.0", 168 | "coffeescript": "^2.7.0", 169 | "kava": "^7.8.0", 170 | "projectz": "^4.1.1", 171 | "safeps": "^11.6.0", 172 | "valid-directory": "^4.8.0" 173 | }, 174 | "scripts": { 175 | "our:bin": "node ./bin.cjs", 176 | "our:clean": "rm -rf ./docs ./edition* ./es2015 ./es5 ./out ./.next", 177 | "our:compile": "npm run our:compile:edition-esnext", 178 | "our:compile:edition-esnext": "coffee -bco ./edition-esnext ./source && printf '%s' '{\"type\": \"commonjs\"}' > edition-esnext/package.json", 179 | "our:deploy": "printf '%s\n' 'no need for this project'", 180 | "our:meta": "npm run our:meta:projectz", 181 | "our:meta:projectz": "projectz --offline", 182 | "our:release": "npm run our:release:prepare && npm run our:release:check-changelog && npm run our:release:check-dirty && npm run our:release:tag && npm run our:release:push", 183 | "our:release:check-changelog": "cat ./HISTORY.md | grep \"v$npm_package_version\" || (printf '%s\n' \"add a changelog entry for v$npm_package_version\" && exit -1)", 184 | "our:release:check-dirty": "git diff --exit-code", 185 | "our:release:prepare": "npm run our:clean && npm run our:compile && npm run our:test && npm run our:meta", 186 | "our:release:push": "git push origin && git push origin --tags", 187 | "our:release:tag": "export MESSAGE=$(cat ./HISTORY.md | sed -n \"/## v$npm_package_version/,/##/p\" | sed 's/## //' | awk 'NR>1{print buf}{buf = $0}') && test \"$MESSAGE\" || (printf '%s\n' 'proper changelog entry not found' && exit -1) && git tag \"v$npm_package_version\" -am \"$MESSAGE\"", 188 | "our:setup": "npm run our:setup:install", 189 | "our:setup:install": "npm install", 190 | "our:test": "npm run our:verify && npm test", 191 | "our:verify": "npm run our:verify:coffeelint", 192 | "our:verify:coffeelint": "coffeelint ./source", 193 | "test": "node ./edition-esnext/test.js" 194 | }, 195 | "testen": { 196 | "serial": true 197 | } 198 | } 199 | -------------------------------------------------------------------------------- /source/bin.coffee: -------------------------------------------------------------------------------- 1 | # Requires 2 | fs = require('fs') 3 | CSON = require('./index.js') 4 | { stdin, stdout, stderr, argv, exit } = process 5 | 6 | # Helpers 7 | help = (message = '') -> 8 | stderr.write """ 9 | CSON CLI 10 | 11 | USAGE 12 | 13 | cson [...options] 14 | 15 | # json to cson, to stdout 16 | cson in.json 17 | 18 | # json to cson, to file 19 | cson in.cson out.cson 20 | 21 | # cson to json, to stdout 22 | cson in.cson 23 | 24 | # cson to json, to file 25 | cson in.cson out.json 26 | 27 | # explicit conversion to support ambigious extension and stdin 28 | 29 | json2cson in.data out.data 30 | json2cson in.data > out.data 31 | cat in.data | json2cson --stdin out.data 32 | 33 | cson --json2cson in.data out.data 34 | cson --json2cson in.data > out.data 35 | cat in.data | cson --json2cson --stdin out.data 36 | 37 | cson --cson2json in.data out.data 38 | cson --cson2json in.data > out.data 39 | cat in.data | cson --cson2json --stdin out.data 40 | 41 | cson2json in.data out.data 42 | cson2json in.data > out.data 43 | cat in.data | cson2json --stdin out.data 44 | 45 | OPTIONS 46 | 47 | --help 48 | Display this help. 49 | 50 | --tabs 51 | --2spaces 52 | --4spaces 53 | Adjust output indentation. 54 | """ 55 | if message 56 | stderr.write "\n\nERROR:\n#{message}\n" 57 | exit(22) 58 | invalidArg = (arg) -> 59 | help("Invalid argument: #{arg}") 60 | 61 | # prepare 62 | conversion = '' 63 | input = '' 64 | output = '' 65 | opts = {} 66 | 67 | # parse 68 | node = argv.shift() 69 | bin = argv.shift() 70 | if bin.includes('json2cson') 71 | conversion = 'json2cson' 72 | else if bin.includes('cson2json') 73 | conversion = 'cson2json' 74 | while argv.length 75 | arg = argv.shift() 76 | switch arg 77 | when '--help' then help() 78 | when '--json2cson' then conversion = 'json2cson' 79 | when '--cson2json' then conversion = 'cson2json' 80 | when '--stdin' then input = '/dev/stdin' 81 | when '--tabs' then opts.indent = '\t' 82 | when '--2spaces' then opts.indent = ' ' 83 | when '--4spaces' then opts.indent = ' ' 84 | else 85 | if !input 86 | input = arg 87 | else if !output 88 | output = arg 89 | else 90 | return invalidArg(arg) 91 | 92 | # determine conversion 93 | if !conversion 94 | if input.endsWith('.json') || output.endsWith('.cson') 95 | conversion = 'json2cson' 96 | else if input.endsWith('.cson') || output.endsWith('.json') 97 | conversion = 'cson2json' 98 | else 99 | return help("Unable to determine conversion from input/output file extensions. You must provide either --json2cson or --cson2json.\n#{node} #{bin} #{input} #{output}}") 100 | 101 | # convert input 102 | if input and input isnt '/dev/stdin' 103 | # prepare file conversion 104 | if conversion is 'cson2json' 105 | parse = CSON.parseCSONFile.bind(CSON) 106 | create = CSON.createJSONString.bind(CSON) 107 | else 108 | parse = CSON.parseJSONFile.bind(CSON) 109 | create = CSON.createCSONString.bind(CSON) 110 | 111 | # convert 112 | result = parse(input) 113 | throw result if result instanceof Error 114 | result = create(result, opts) 115 | throw result if result instanceof Error 116 | 117 | # output 118 | if output 119 | fs.writeFileSync(output, result) 120 | else 121 | stdout.write(result) 122 | 123 | else 124 | # convert stdin 125 | data = '' 126 | hasData = -> 127 | return data.replace(/\s+/, '').length isnt 0 128 | processData = -> 129 | # prepare string conversion 130 | if conversion is 'cson2json' 131 | parse = CSON.parseCSONString.bind(CSON) 132 | create = CSON.createJSONString.bind(CSON) 133 | else 134 | parse = CSON.parseJSONString.bind(CSON) 135 | create = CSON.createCSONString.bind(CSON) 136 | 137 | # convert 138 | result = parse(data) 139 | throw result if result instanceof Error 140 | result = create(result, opts) 141 | throw result if result instanceof Error 142 | 143 | # output 144 | if output 145 | fs.writeFileSync(output, result) 146 | else 147 | stdout.write(result) 148 | 149 | # timeout if we don't have stdin 150 | timeoutFunction = -> 151 | # clear timeout 152 | clearTimeout(timeout) 153 | timeout = null 154 | # if we didn't detect output, then fail 155 | if hasData() is false 156 | stdin.pause() 157 | help('No STDIN data received...') 158 | timeout = setTimeout(timeoutFunction, 1000) 159 | 160 | # read stdin 161 | stdin = stdin 162 | stdin.setEncoding('utf8') 163 | stdin.resume() # node 0.8 164 | stdin.on 'data', (_data) -> 165 | data += _data.toString() 166 | stdin.on 'end', -> 167 | if timeout 168 | clearTimeout(timeout) 169 | timeout = null 170 | processData() 171 | -------------------------------------------------------------------------------- /source/index.coffee: -------------------------------------------------------------------------------- 1 | # Imports 2 | fsUtil = require('safefs') 3 | pathUtil = require('path') 4 | extractOptsAndCallback = require('extract-opts') 5 | requireFresh = require('requirefresh').default 6 | 7 | # Public: The exported CSON singleton 8 | class CSON 9 | # ==================================== 10 | # Helpers 11 | 12 | # Internal: Ensure Error Type 13 | ensureErrorType: (err) -> 14 | if err instanceof Error 15 | return err 16 | else 17 | return @ensureErrorType(err) 18 | 19 | # Internal: Complete with callback if it exists 20 | complete: (result, next) -> 21 | # Complete 22 | if next 23 | if result instanceof Error 24 | next(result) 25 | else 26 | next(null, result) 27 | return @ 28 | else 29 | return result 30 | 31 | # Internal: Fills in any missing options for use in our methods 32 | # 33 | # opts - {Object} The options to prepare 34 | # 35 | # Returns the same opts {Object} that we received 36 | getOptions: (opts={}) -> 37 | opts.format ?= null 38 | opts.filename ?= null 39 | if opts.filename 40 | opts.filename = pathUtil.resolve(opts.filename) 41 | opts.format ?= @getFormat(opts.filename) 42 | if opts.filename is null 43 | delete opts.filename 44 | 45 | opts.json ?= true 46 | opts.cson ?= true 47 | opts.javascript ?= false 48 | opts.coffeescript ?= false 49 | 50 | return opts 51 | 52 | # Internal: Gets the format for a file name or path 53 | # 54 | # file - {String} to get the format for 55 | # 56 | # Returns the determined format as a {String} ("json", "cson", "coffeescript", or "javascript", or null) 57 | getFormat: (file) -> 58 | return switch pathUtil.extname(file) 59 | when '.json' 60 | 'json' 61 | when '.cson' 62 | 'cson' 63 | when '.coffee' 64 | 'coffeescript' 65 | when '.js' 66 | 'javascript' 67 | else 68 | null 69 | 70 | # Internal: Helper for {::createString}, {::parseString}, {::parseFile}, {::requireFile} 71 | action: (args) -> 72 | # Prepare 73 | {action, prefix, suffix, data, opts, next} = args 74 | suffix ?= '' 75 | [opts, next] = extractOptsAndCallback(opts, next) 76 | 77 | # Prepare options 78 | switch action 79 | when 'requireFile', 'parseFile' 80 | opts.filename ?= data 81 | 82 | # Add defaults 83 | opts = @getOptions(opts) 84 | 85 | # Default: CSON 86 | if opts.format in [null, 'cson'] 87 | if opts.cson is true 88 | result = @[prefix+'CSON'+suffix](data, opts) 89 | else 90 | result = new Error("CSON.#{action}: Desired format is CSON however CSON is disabled by an option") 91 | 92 | # JSON 93 | else if opts.format is 'json' 94 | if opts.json is true 95 | result = @[prefix+'JSON'+suffix](data, opts) 96 | else 97 | result = new Error("CSON.#{action}: Desired format is JSON however JSON is disabled by an option") 98 | 99 | # JavaScript 100 | else if opts.format is 'javascript' 101 | if opts.javascript is true 102 | result = @[prefix+'JS'+suffix](data, opts) 103 | else 104 | result = new Error("CSON.#{action}: Desired format is JavaScript however JavaScript is disabled by an option") 105 | 106 | # CoffeeScript 107 | else if opts.format is 'coffeescript' 108 | if opts.coffeescript is true 109 | result = @[prefix+'CS'+suffix](data, opts) 110 | else 111 | result = new Error("CSON.#{action}: Desired format is CoffeeScript however CoffeeScript is disabled by an option") 112 | 113 | else 114 | result = new Error("CSON.#{action}: Desired format is not supported") 115 | 116 | # Complete 117 | return @complete(result, next) 118 | 119 | 120 | 121 | # ==================================== 122 | # Bundles 123 | 124 | # Public: {Delegates to: .createString} 125 | stringify: (data, replacer, indent) -> 126 | opts = {} 127 | opts.replacer = replacer 128 | opts.indent = indent 129 | return @createCSONString(data, opts) 130 | 131 | # Public: {Delegates to: .parseCSONString} 132 | parse: (data, opts, next) -> 133 | return @parseCSONString(data, opts, next) 134 | 135 | # Public: {Delegates to: .parseCSONFile} 136 | load: (data, opts, next) -> 137 | return @parseCSONFile(data, opts, next) 138 | 139 | # Public: Converts an {Object} into a {String} of the desired format 140 | # 141 | # If the format option is not specified, we default to CSON 142 | # 143 | # data - {Object} The data to convert 144 | # opts - {Object} The options (options may also be forwarded onto the parser library) 145 | # :format - {String} The format to use: "cson" (default), "json", "coffeescript", or "javascript" 146 | # :cson - {Boolean} Whether or not the CSON format should be allowed (defaults to `true`) 147 | # :json - {Boolean} Whether or not the JSON format should be allowed (defaults to `true`) 148 | # 149 | # Returns {String} or {Error} 150 | createString: (data, opts, next) -> 151 | return @action({ 152 | action: 'createString' 153 | prefix: 'create' 154 | suffix: 'String' 155 | data, opts, next 156 | }) 157 | 158 | # Public: Converts a {String} of the desired format into an {Object} 159 | # 160 | # If the format option is not specified, we default to CSON 161 | # 162 | # data - {String} The string to parse 163 | # opts - {Object} The options (options may also be forwarded onto the parser library) 164 | # :format - {String} The format to use: "cson" (default), "json", "coffeescript", or "javascript" 165 | # :cson - {Boolean} Whether or not the CSON format should be allowed (defaults to `true`) 166 | # :json - {Boolean} Whether or not the JSON format should be allowed (defaults to `true`) 167 | # :coffeescript - {Boolean} Whether or not the CoffeeScript format should be allowed (defaults to `false`) 168 | # :json - {Boolean} Whether or not the CoffeeScript format should be allowed (defaults to `json`) 169 | # 170 | # Returns {Object} or {Error} 171 | parseString: (data, opts, next) -> 172 | return @action({ 173 | action: 'parseString' 174 | prefix: 'parse' 175 | suffix: 'String' 176 | data, opts, next 177 | }) 178 | 179 | # Public: Parses a file path of the desired format into an {Object} 180 | # 181 | # If the format option is not specified, we use the filename to detect what it should be, otherwise we default to CSON 182 | # 183 | # data - {String} The file path to parse 184 | # opts - {Object} The options (options may also be forwarded onto the parser library) 185 | # :format - {String} The format to use: "cson" (default), "json", "coffeescript", or "javascript" 186 | # :cson - {Boolean} Whether or not the CSON format should be allowed (defaults to `true`) 187 | # :json - {Boolean} Whether or not the JSON format should be allowed (defaults to `true`) 188 | # :coffeescript - {Boolean} Whether or not the CoffeeScript format should be allowed (defaults to `false`) 189 | # :json - {Boolean} Whether or not the CoffeeScript format should be allowed (defaults to `json`) 190 | # 191 | # Returns {Object} or {Error} 192 | parseFile: (data, opts, next) -> 193 | return @action({ 194 | action: 'parseFile' 195 | prefix: 'parse' 196 | suffix: 'File' 197 | data, opts, next 198 | }) 199 | 200 | # Public: Requires or parses a file path of the desired format into an {Object} 201 | # 202 | # If the format option is not specified, we use the filename to detect what it should be, otherwise we default to CSON 203 | # 204 | # data - {String} The file path to require or parse 205 | # opts - {Object} The options (options may also be forwarded onto the parser library) 206 | # :format - {String} The format to use: "cson" (default), "json", "coffeescript", or "javascript" 207 | # :cson - {Boolean} Whether or not the CSON format should be allowed (defaults to `true`) 208 | # :json - {Boolean} Whether or not the JSON format should be allowed (defaults to `true`) 209 | # :coffeescript - {Boolean} Whether or not the CoffeeScript format should be allowed (defaults to `false`) 210 | # :json - {Boolean} Whether or not the CoffeeScript format should be allowed (defaults to `json`) 211 | # 212 | # Returns {Object} or {Error} 213 | requireFile: (data, opts, next) -> 214 | return @action({ 215 | action: 'requireFile' 216 | prefix: 'require' 217 | suffix: 'File' 218 | data, opts, next 219 | }) 220 | 221 | 222 | # ==================================== 223 | # Creating Strings from Objects 224 | 225 | # Public: Converts an {Object} into a JSON {String} 226 | # 227 | # data - {Object} The data to convert 228 | # opts - {Object} The options (options may also be forwarded onto the parser library) 229 | # :replacer - {Boolean} The replacer option for `JSON.stringify` (defaults to `null`) 230 | # :indent - {Boolean} The indent option for `JSON.stringify` (defaults to two spaces ` `) 231 | # 232 | # Returns {String} or {Error} 233 | createJSONString: (data, opts, next) -> 234 | # Prepare 235 | [opts, next] = extractOptsAndCallback(opts, next) 236 | opts = @getOptions(opts) 237 | opts.replacer ?= null 238 | opts.indent ?= ' ' 239 | 240 | # Stringify 241 | try 242 | result = JSON.stringify(data, opts.replacer, opts.indent) 243 | catch err 244 | result = @ensureErrorType(err) 245 | 246 | # Complete 247 | return @complete(result, next) 248 | 249 | # Public: Converts an {Object} into a CSON {String} 250 | # 251 | # data - {Object} The data to convert 252 | # opts - {Object} The options (options may also be forwarded onto the parser library) 253 | # :replacer - {Boolean} The replacer option for `require('cson-parser').stringify` (defaults to `null`) 254 | # :indent - {Boolean} The indent option for `require('cson-parser').stringify` (defaults to a single tab `'\t'`) 255 | # 256 | # Returns {String} or {Error} 257 | createCSONString: (data, opts, next) -> 258 | # Prepare 259 | [opts, next] = extractOptsAndCallback(opts, next) 260 | opts = @getOptions(opts) 261 | opts.replacer ?= null 262 | opts.indent ?= '\t' 263 | 264 | # Stringify 265 | try 266 | result = require('cson-parser').stringify(data, opts.replacer, opts.indent) 267 | catch err 268 | result = @ensureErrorType(err) 269 | 270 | # Complete 271 | return @complete(result, next) 272 | 273 | # Private: Not yet supported 274 | createCSString: (data, opts, next) -> 275 | # Prepare 276 | [opts, next] = extractOptsAndCallback(opts, next) 277 | 278 | # Stringify 279 | result = new Error('CSON.createCS: Creating CoffeeScript code is not yet supported') 280 | 281 | # Complete 282 | return @complete(result, next) 283 | 284 | ### 285 | Potentially we could use something like the following from CSON v1 286 | However the JSON.stringify gets rid of functions... 287 | which is the entire point of the coffeescript mode over the CSON mode... 288 | So until we figure out how to toString() an object and keep the functions intact, 289 | unsafe stringifying to CSON or CS or JS won't happen. 290 | 291 | Perhaps https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toSource 292 | will be of use one day 293 | 294 | src = "var result = #{JSON.stringify obj}" 295 | result = require('js2coffee').build(src, opts).code 296 | result = result.replace(/^\s*result\s*\=\s/, '') 297 | if /^\s/.test(result) is false 298 | result = result.trim() 299 | if typeof obj is 'object' 300 | unless Array.isArray(obj) 301 | result = '{'+result+'}' unless result is '{}' 302 | return result 303 | ### 304 | 305 | 306 | # Private: Not yet supported 307 | createJSString: (data, opts, next) -> 308 | # Prepare 309 | [opts, next] = extractOptsAndCallback(opts, next) 310 | 311 | # Stringify 312 | result = new Error('CSON.createJS: Creating JavaScript code is not yet supported') 313 | 314 | # Complete 315 | return @complete(result, next) 316 | 317 | 318 | # ==================================== 319 | # Parsing Strings to Objects 320 | 321 | # Public: Parses a JSON {String} into an {Object} 322 | # 323 | # data - The JSON {String} to parse 324 | # opts - {Object} The options, unused 325 | # 326 | # Returns {Object} or {Error} 327 | parseJSONString: (data, opts, next) -> 328 | # Prepare 329 | [opts, next] = extractOptsAndCallback(opts, next) 330 | 331 | # Parse 332 | try 333 | result = JSON.parse(data) 334 | catch err 335 | result = @ensureErrorType(err) 336 | 337 | # Complete 338 | return @complete(result, next) 339 | 340 | # Public: Parses a CSON {String} into an {Object} 341 | # 342 | # data - The CSON {String} to parse 343 | # opts - {Object} The options, unused 344 | # 345 | # Returns {Object} or {Error} 346 | parseCSONString: (data, opts, next) -> 347 | # Prepare 348 | [opts, next] = extractOptsAndCallback(opts, next) 349 | 350 | # Parse 351 | try 352 | result = require('cson-parser').parse(data) 353 | catch err 354 | result = @ensureErrorType(err) 355 | 356 | # Complete 357 | return @complete(result, next) 358 | 359 | # Public: Parses a JavaScript {String} into an {Object} 360 | # 361 | # data - The JavaScript {String} to parse 362 | # opts - {Object} The options (also passed to require('vm').runInNewContex) 363 | # :context - {Object} The context option that is used in `require('vm').runInNewContext`, defaults to an empty object `{}` 364 | # 365 | # Returns {Object} or {Error} 366 | parseJSString: (data, opts, next) -> 367 | # Prepare 368 | [opts, next] = extractOptsAndCallback(opts, next) 369 | opts = @getOptions(opts) 370 | opts.context ?= {} 371 | 372 | # Parse 373 | try 374 | result = require('vm').runInNewContext(data, opts.context, opts) 375 | catch err 376 | result = @ensureErrorType(err) 377 | 378 | # Complete 379 | return @complete(result, next) 380 | 381 | # Public: Parses a CoffeeScript {String} into an {Object} 382 | # 383 | # data - The CoffeeScript {String} to parse 384 | # opts - {Object} The options, forwarded onto `require('coffeescript').eval` 385 | # 386 | # Returns {Object} or {Error} 387 | parseCSString: (data, opts, next) -> 388 | # Prepare 389 | [opts, next] = extractOptsAndCallback(opts, next) 390 | opts = @getOptions(opts) 391 | 392 | # Parse 393 | try 394 | result = require('coffeescript').eval(data, opts) 395 | catch err 396 | result = @ensureErrorType(err) 397 | 398 | # Complete 399 | return @complete(result, next) 400 | 401 | 402 | # ==================================== 403 | # Parsing Files to Objects 404 | 405 | # Public: Parses a JSON file into an {Object} 406 | # 407 | # data - {String} The file path to parse 408 | # opts - {Object} The options, forwarded onto {::parseJSONString} 409 | # 410 | # Returns {Object} or {Error} 411 | parseJSONFile: (file, opts, next) -> 412 | # Prepare 413 | [opts, next] = extractOptsAndCallback(opts, next) 414 | 415 | # Parse 416 | result = fsUtil.readFileSync(file) 417 | if result instanceof Error 418 | result = result 419 | else 420 | result = @parseJSONString(result.toString(), opts) 421 | 422 | # Complete 423 | return @complete(result, next) 424 | 425 | # Public: Parses a CSON file into an {Object} 426 | # 427 | # data - {String} The file path to parse 428 | # opts - {Object} The options, forwarded onto {::parseCSONString} 429 | # 430 | # Returns {Object} or {Error} 431 | parseCSONFile: (file, opts, next) -> 432 | # Prepare 433 | [opts, next] = extractOptsAndCallback(opts, next) 434 | 435 | # Parse 436 | result = fsUtil.readFileSync(file) 437 | if result instanceof Error 438 | result = result 439 | else 440 | result = @parseCSONString(result.toString(), opts) 441 | 442 | # Complete 443 | return @complete(result, next) 444 | 445 | # Public: Parses a JAvaScript file into an {Object} 446 | # 447 | # data - {String} The file path to parse 448 | # opts - {Object} The options, forwarded onto {::parseJSString} 449 | # 450 | # Returns {Object} or {Error} 451 | parseJSFile: (file, opts, next) -> 452 | # Prepare 453 | [opts, next] = extractOptsAndCallback(opts, next) 454 | 455 | # Parse 456 | result = fsUtil.readFileSync(file) 457 | if result instanceof Error 458 | result = result 459 | else 460 | result = @parseJSString(result.toString(), opts) 461 | 462 | # Complete 463 | return @complete(result, next) 464 | 465 | # Public: Parses a CoffeeScript file into an {Object} 466 | # 467 | # data - {String} The file path to parse 468 | # opts - {Object} The options, forwarded onto {::parseCSString} 469 | # 470 | # Returns {Object} or {Error} 471 | parseCSFile: (file, opts, next) -> 472 | # Prepare 473 | [opts, next] = extractOptsAndCallback(opts, next) 474 | 475 | # Parse 476 | result = fsUtil.readFileSync(file) 477 | if result instanceof Error 478 | result = result 479 | else 480 | result = @parseCSString(result.toString(), opts) 481 | 482 | # Complete 483 | return @complete(result, next) 484 | 485 | 486 | 487 | # ==================================== 488 | # Requiring Files to Objects 489 | 490 | # Public: {Delegates to: .parseJSONFile} 491 | requireJSONFile: (file, opts, next) -> 492 | # Prepare 493 | [opts, next] = extractOptsAndCallback(opts, next) 494 | 495 | # Require 496 | result = @parseJSONFile(file, opts) 497 | 498 | # Complete 499 | return @complete(result, next) 500 | 501 | # Public: {Delegates to: .parseCSONFile} 502 | requireCSONFile: (file, opts, next) -> 503 | # Prepare 504 | [opts, next] = extractOptsAndCallback(opts, next) 505 | 506 | # Require 507 | result = @parseCSONFile(file, opts) 508 | 509 | # Complete 510 | return @complete(result, next) 511 | 512 | # Public: Requires a JavaScript file and returns the result {Object} 513 | # 514 | # data - {String} The file path to require 515 | # opts - {Object} The options, unused 516 | # 517 | # Returns {Object} or {Error} 518 | requireJSFile: (file, opts, next) -> 519 | # Prepare 520 | [opts, next] = extractOptsAndCallback(opts, next) 521 | 522 | # Require 523 | try 524 | result = requireFresh(file) 525 | catch err 526 | result = @ensureErrorType(err) 527 | 528 | # Complete 529 | return @complete(result, next) 530 | 531 | # Public: Requires a CoffeeScript file and returns the result {Object} 532 | # 533 | # data - {String} The file path to require 534 | # opts - {Object} The options, unused 535 | # 536 | # Returns {Object} or {Error} 537 | requireCSFile: (file, opts, next) -> 538 | # Prepare 539 | [opts, next] = extractOptsAndCallback(opts, next) 540 | 541 | # Require 542 | require('coffeescript/register') 543 | try 544 | result = requireFresh(file) 545 | catch err 546 | result = @ensureErrorType(err) 547 | 548 | # Complete 549 | return @complete(result, next) 550 | 551 | # Export 552 | module.exports = new CSON() 553 | -------------------------------------------------------------------------------- /source/test.coffee: -------------------------------------------------------------------------------- 1 | # Requires 2 | kava = require('kava') 3 | fsUtil = require('fs') 4 | {resolve, join} = require('path') 5 | safeps = require('safeps') 6 | {equal, deepEqual, errorEqual, contains} = require('assert-helpers') 7 | CSON = require('./index.js') 8 | 9 | # Configuraiton 10 | rootPath = resolve(__dirname, '..') 11 | binPath = join(rootPath, 'bin.cjs') 12 | testFixturesPath = join(rootPath, 'test-fixtures') 13 | apiDirectoryPath = join(testFixturesPath, 'api') 14 | srcDirectoryPath = join(testFixturesPath, 'src') 15 | outDirectoryPath = join(testFixturesPath, 'out-expected') 16 | testExtensions = [ 17 | # 1 18 | # Test simple example 19 | # to make sure the output is readable 20 | 'cson' 21 | 22 | # 2 23 | # Test multiline string 24 | # to make sure the output is readable 25 | 'cson' 26 | 27 | # 3 28 | # Test standard array 29 | # to make sure the output is readable 30 | 'cson' 31 | 32 | # 4 33 | # Test JSON 34 | # to make sure our JSON parsing works correctly 35 | 'json' 36 | 37 | # 5 38 | # Test CoffeeScript 39 | # to make sure requiring a coffeescript file includes the correct globals 40 | # and renders correctly 41 | 'coffee' 42 | 43 | # 6 44 | # Test JavaScript 45 | # same reasoning as test 5 46 | 'js' 47 | 48 | # 7 49 | # Test CoffeeScript 50 | # to make sure that sandboxing is working correctly 51 | 'coffee' 52 | 53 | # 8 54 | # Test CSON 55 | # to make sure that an empty object is actually outputted 56 | 'cson' 57 | ] 58 | 59 | 60 | # ===================================== 61 | # Tests 62 | 63 | kava.suite 'cson', (suite,test) -> 64 | suite 'api', (suite, test) -> 65 | suite 'CSON', (suite, test) -> 66 | data = a:b:1 67 | strTabs = 'a:\n\tb: 1' 68 | strSpaces = 'a:\n b: 1' 69 | 70 | test 'stringify', -> 71 | csonString = CSON.stringify(data) 72 | equal(csonString, strTabs) 73 | 74 | test 'stringify spaces', -> 75 | csonString = CSON.stringify(data, null, ' ') 76 | equal(csonString, strSpaces) 77 | 78 | test 'createCSONString', -> 79 | csonString = CSON.createCSONString(data) 80 | equal(csonString, strTabs) 81 | 82 | test 'createCSONString spaces', -> 83 | csonString = CSON.createCSONString(data, {indent:' '}) 84 | equal(csonString, strSpaces) 85 | 86 | test 'createCSONString callback', -> 87 | CSON.createCSONString data, (err, csonString) -> 88 | errorEqual(err, null) 89 | equal(csonString, strTabs) 90 | 91 | test 'createCSONString spaces callback', -> 92 | CSON.createCSONString data, {indent:' '}, (err, csonString) -> 93 | errorEqual(err, null) 94 | equal(csonString, strSpaces) 95 | 96 | test 'parse', -> 97 | csonData = CSON.parse(strTabs) 98 | deepEqual(csonData, data) 99 | 100 | test 'parseCSONString', -> 101 | csonData = CSON.parseCSONString(strTabs) 102 | deepEqual(csonData, data) 103 | 104 | test 'parseCSONString callback', -> 105 | CSON.parseCSONString strTabs, (err, csonData) -> 106 | errorEqual(err, null) 107 | deepEqual(csonData, data) 108 | 109 | test 'load', -> 110 | csonData = CSON.load(apiDirectoryPath+'/cson-parse.cson') 111 | deepEqual(csonData, data) 112 | 113 | test 'load callback', -> 114 | CSON.load apiDirectoryPath+'/cson-parse.cson', (err, csonData) -> 115 | errorEqual(err, null) 116 | deepEqual(csonData, data) 117 | 118 | test 'parseCSONFile', -> 119 | csonData = CSON.parseCSONFile(apiDirectoryPath+'/cson-parse.cson') 120 | deepEqual(csonData, data) 121 | 122 | test 'parseCSONFile callback', -> 123 | CSON.parseCSONFile apiDirectoryPath+'/cson-parse.cson', (err, csonData) -> 124 | errorEqual(err, null) 125 | deepEqual(csonData, data) 126 | 127 | test 'requireCSONFile', -> 128 | csonData = CSON.requireCSONFile(apiDirectoryPath+'/cson-parse.cson') 129 | deepEqual(csonData, data) 130 | 131 | test 'requireCSONFile callback', -> 132 | CSON.requireCSONFile apiDirectoryPath+'/cson-parse.cson', (err, csonData) -> 133 | errorEqual(err, null) 134 | deepEqual(csonData, data) 135 | 136 | suite 'JSON', (suite, test) -> 137 | data = a:b:1 138 | strSpaces = '{\n "a": {\n "b": 1\n }\n}' 139 | strTabs = '{\n\t"a": {\n\t\t"b": 1\n\t}\n}' 140 | 141 | test 'createJSONString', -> 142 | jsonString = CSON.createJSONString(data) 143 | equal(jsonString, strSpaces) 144 | 145 | test 'createJSONString tabs', -> 146 | jsonString = CSON.createJSONString(data, {indent:'\t'}) 147 | equal(jsonString, strTabs) 148 | 149 | test 'createJSONString callback', -> 150 | CSON.createJSONString data, (err,jsonString) -> 151 | errorEqual(err, null) 152 | equal(jsonString, strSpaces) 153 | 154 | test 'createJSONString callback tabs', -> 155 | CSON.createJSONString data, {indent:'\t'}, (err, jsonString) -> 156 | errorEqual(err, null) 157 | equal(jsonString, strTabs) 158 | 159 | test 'parseJSONString', -> 160 | jsonData = CSON.parseJSONString(strSpaces) 161 | deepEqual(jsonData, data) 162 | 163 | test 'parseJSONString callback', -> 164 | CSON.parseJSONString strSpaces, (err, jsonData) -> 165 | errorEqual(err, null) 166 | deepEqual(jsonData, data) 167 | 168 | test 'parseJSONFile', -> 169 | jsonData = CSON.parseJSONFile(apiDirectoryPath+'/json-parse.json') 170 | deepEqual(jsonData, data) 171 | 172 | test 'parseJSONFile callback', -> 173 | CSON.parseJSONFile apiDirectoryPath+'/json-parse.json', (err, jsonData) -> 174 | errorEqual(err, null) 175 | deepEqual(jsonData, data) 176 | 177 | test 'requireJSONFile', -> 178 | jsonData = CSON.requireJSONFile(apiDirectoryPath+'/json-parse.json') 179 | deepEqual(jsonData, data) 180 | 181 | test 'requireJSONFile callback', -> 182 | CSON.requireJSONFile apiDirectoryPath+'/json-parse.json', (err, jsonData) -> 183 | errorEqual(err, null) 184 | deepEqual(jsonData, data) 185 | 186 | 187 | suite 'JS', (suite, test) -> 188 | data = 25 189 | str = '5*5' 190 | 191 | test 'parseJSString', -> 192 | jsData = CSON.parseJSString(str) 193 | equal(jsData, data) 194 | 195 | test 'parseJSString callback', -> 196 | CSON.parseJSString str, (err, jsData) -> 197 | errorEqual(err, null) 198 | equal(jsData, data) 199 | 200 | test 'parseJSFile', -> 201 | jsData = CSON.parseJSFile(apiDirectoryPath+'/js-parse.js') 202 | equal(jsData, data) 203 | 204 | test 'parseJSFile callback', -> 205 | CSON.parseJSFile apiDirectoryPath+'/js-parse.js', (err, jsData) -> 206 | errorEqual(err, null) 207 | equal(jsData, data) 208 | 209 | test 'requireJSFile', -> 210 | jsData = CSON.requireJSFile(apiDirectoryPath+'/js-require.js') 211 | equal(jsData, data) 212 | 213 | test 'requireJSFile callback', -> 214 | CSON.requireJSFile apiDirectoryPath+'/js-require.js', (err, jsData) -> 215 | errorEqual(err, null) 216 | equal(jsData, data) 217 | 218 | suite 'CS', (suite, test) -> 219 | data = 25 220 | str = '"#{5}"*5' 221 | 222 | test 'parseCSString', -> 223 | csData = CSON.parseCSString(str) 224 | equal(csData, data) 225 | 226 | test 'parseCSString callback', -> 227 | CSON.parseCSString str, (err, csData) -> 228 | errorEqual(err, null) 229 | equal(csData, data) 230 | 231 | test 'parseCSFile', -> 232 | csData = CSON.parseCSFile(apiDirectoryPath+'/cs-parse.coffee') 233 | equal(csData, data) 234 | 235 | test 'parseCSFile callback', -> 236 | CSON.parseCSFile apiDirectoryPath+'/cs-parse.coffee', (err, csData) -> 237 | errorEqual(err, null) 238 | equal(csData, data) 239 | 240 | test 'requireCSFile', -> 241 | csData = CSON.requireCSFile(apiDirectoryPath+'/cs-require.coffee') 242 | equal(csData, data) 243 | 244 | test 'requireCSFile callback', -> 245 | CSON.requireCSFile apiDirectoryPath+'/cs-require.coffee', (err, jsData) -> 246 | errorEqual(err, null) 247 | equal(jsData, data) 248 | 249 | suite 'createString', (suite, test) -> 250 | data = a:b:1 251 | csonString = 'a:\n\tb: 1' 252 | jsonString = '{\n "a": {\n "b": 1\n }\n}' 253 | 254 | test 'CSON', -> 255 | CSON.createString data, (err, result) -> 256 | errorEqual(err, null) 257 | equal(result, csonString) 258 | 259 | test 'JSON', -> 260 | CSON.createString data, {format:'json'}, (err, result) -> 261 | errorEqual(err, null) 262 | equal(result, jsonString) 263 | 264 | test 'JS', -> 265 | CSON.createString data, {format:'javascript'}, (err, result) -> 266 | errorEqual(err, 'disabled') 267 | 268 | test 'JS', -> 269 | CSON.createString data, {format:'javascript', javascript:true}, (err, result) -> 270 | errorEqual(err, 'not yet supported') 271 | 272 | test 'CS', -> 273 | CSON.createString data, {format:'coffeescript'}, (err, result) -> 274 | errorEqual(err, 'disabled') 275 | 276 | test 'CS', -> 277 | CSON.createString data, {format:'coffeescript', coffeescript:true}, (err, result) -> 278 | errorEqual(err, 'not yet supported') 279 | 280 | suite 'parseString', (suite, test) -> 281 | data = a:b:1 282 | number = 25 283 | csonString = 'a:\n\tb: 1' 284 | jsonString = '{\n "a": {\n "b": 1\n }\n}' 285 | jsString = '5*5' 286 | csString = '"#{5}"*5' 287 | 288 | test 'CSON', -> 289 | CSON.parseString csonString, (err, result) -> 290 | errorEqual(err, null) 291 | deepEqual(result, data) 292 | 293 | test 'JSON', -> 294 | CSON.parseString jsonString, {format:'json'}, (err, result) -> 295 | errorEqual(err, null) 296 | deepEqual(result, data) 297 | 298 | test 'JS', -> 299 | CSON.parseString jsString, {format:'javascript'}, (err, result) -> 300 | errorEqual(err, 'disabled') 301 | 302 | test 'JS', -> 303 | CSON.parseString jsString, {format:'javascript', javascript:true}, (err, result) -> 304 | errorEqual(err, null) 305 | equal(result, number) 306 | 307 | test 'CS', -> 308 | CSON.parseString csString, {format:'coffeescript'}, (err, result) -> 309 | errorEqual(err, 'disabled') 310 | 311 | test 'CS', -> 312 | CSON.parseString csString, {format:'coffeescript', coffeescript:true}, (err, result) -> 313 | errorEqual(err, null) 314 | equal(result, number) 315 | 316 | suite 'parseFile', (suite, test) -> 317 | data = a:b:1 318 | number = 25 319 | 320 | test 'CSON', -> 321 | CSON.parseFile apiDirectoryPath+'/cson-parse.cson', (err, result) -> 322 | errorEqual(err, null) 323 | deepEqual(result, data) 324 | 325 | test 'JSON', -> 326 | CSON.parseFile apiDirectoryPath+'/json-parse.json', {format:'json'}, (err, result) -> 327 | errorEqual(err, null) 328 | deepEqual(result, data) 329 | 330 | test 'JS', -> 331 | CSON.parseFile apiDirectoryPath+'/js-parse.js', {format:'javascript'}, (err, result) -> 332 | errorEqual(err, 'disabled') 333 | 334 | test 'JS', -> 335 | CSON.parseFile apiDirectoryPath+'/js-parse.js', {format:'javascript', javascript:true}, (err, result) -> 336 | errorEqual(err, null) 337 | equal(result, number) 338 | 339 | test 'CS', -> 340 | CSON.parseFile apiDirectoryPath+'/cs-parse.coffee', {format:'coffeescript'}, (err, result) -> 341 | errorEqual(err, 'disabled') 342 | 343 | test 'CS', -> 344 | CSON.parseFile apiDirectoryPath+'/cs-parse.coffee', {format:'coffeescript', coffeescript:true}, (err, result) -> 345 | errorEqual(err, null) 346 | equal(result, number) 347 | 348 | suite 'requireFile', (suite, test) -> 349 | data = a:b:1 350 | number = 25 351 | 352 | test 'CSON', -> 353 | CSON.requireFile apiDirectoryPath+'/cson-parse.cson', (err, result) -> 354 | errorEqual(err, null) 355 | deepEqual(result, data) 356 | 357 | test 'JSON', -> 358 | CSON.requireFile apiDirectoryPath+'/json-parse.json', {format:'json'}, (err, result) -> 359 | errorEqual(err, null) 360 | deepEqual(result, data) 361 | 362 | test 'JS', -> 363 | CSON.requireFile apiDirectoryPath+'/js-require.js', {format:'javascript'}, (err, result) -> 364 | errorEqual(err, 'disabled') 365 | 366 | test 'JS', -> 367 | CSON.requireFile apiDirectoryPath+'/js-require.js', {format:'javascript', javascript:true}, (err, result) -> 368 | errorEqual(err, null) 369 | equal(result, number) 370 | 371 | test 'CS', -> 372 | CSON.requireFile apiDirectoryPath+'/cs-require.coffee', {format:'coffeescript'}, (err, result) -> 373 | errorEqual(err, 'disabled') 374 | 375 | test 'CS', -> 376 | CSON.requireFile apiDirectoryPath+'/cs-require.coffee', {format:'coffeescript', coffeescript:true}, (err, result) -> 377 | errorEqual(err, null) 378 | equal(result, number) 379 | 380 | ### 381 | @TODO Write some tests for createString, parseString, parseFile, and requireFile 382 | To make sure the permissions and multiple format parsing works 383 | ### 384 | 385 | 386 | suite 'fixtures', (suite, test) -> 387 | # Prepare 388 | createTest = (testExtension,i) -> 389 | # Prepare 390 | index = i+1 391 | srcFilename = index+'.'+testExtension 392 | srcPath = srcDirectoryPath+'/'+srcFilename 393 | expectedJsonPath = outDirectoryPath+'/'+index+'.json' 394 | expectedCsonPath = outDirectoryPath+'/'+index+'.cson' 395 | obj = null 396 | requiredObj = null 397 | actualJsonStr = null 398 | actualCsonStr = null 399 | expectedJsonStr = null 400 | expectedCsonStr = null 401 | 402 | # Test 403 | suite srcFilename, (suite,test) -> 404 | test "parse source file", (done) -> 405 | format = CSON.getFormat(srcPath) 406 | 407 | if index is 7 408 | obj = CSON.parseCSFile(srcPath, {sandbox: {}}) 409 | 410 | else if format in ['javascript', 'coffeescript'] 411 | obj = CSON.requireFile(srcPath) 412 | contains(obj.message, 'disabled') 413 | obj = CSON.requireFile(srcPath, {javascript:true, coffeescript:true}) 414 | else 415 | obj = CSON.requireFile(srcPath) 416 | 417 | if obj instanceof Error 418 | return done(obj) 419 | else 420 | return done() 421 | 422 | test "grab conversions", (done) -> 423 | actualJsonStr = JSON.stringify(obj, null, ' ') 424 | actualCsonStr = CSON.stringify(obj, null, '\t') 425 | 426 | if actualCsonStr instanceof Error 427 | return done(actualCsonStr) 428 | else 429 | return done() 430 | 431 | test "read expectations", -> 432 | expectedJsonStr = fsUtil.readFileSync(expectedJsonPath).toString() 433 | expectedCsonStr = fsUtil.readFileSync(expectedCsonPath).toString() 434 | 435 | test "compare json", -> 436 | equal(actualJsonStr, expectedJsonStr) 437 | test "compare cson", -> 438 | equal(actualCsonStr, expectedCsonStr) 439 | 440 | # Create Tests 441 | for testExtension,i in testExtensions 442 | createTest(testExtension,i) 443 | 444 | suite 'cli', (suite, test) -> 445 | cliTests = [ 446 | name: 'json2cson' 447 | spawn: ['node', binPath, '--json2cson'] # ['npx', '-q', '.', '--json2cson'] 448 | sourcePath: join(outDirectoryPath, '1.json') 449 | sourceData: fsUtil.readFileSync(join(outDirectoryPath, '1.json'), 'utf8') 450 | expectedData: fsUtil.readFileSync(join(outDirectoryPath, '1.cson'), 'utf8') 451 | , 452 | name: 'cson2json' 453 | spawn: ['node', binPath, '--cson2json'] # ['npx', '-q', '.', '--cson2json'] 454 | sourcePath: join(outDirectoryPath, '1.cson') 455 | sourceData: fsUtil.readFileSync(join(outDirectoryPath, '1.cson'), 'utf8') 456 | expectedData: fsUtil.readFileSync(join(outDirectoryPath, '1.json'), 'utf8') 457 | ] 458 | 459 | cliTests.forEach (cliTest) -> 460 | suite cliTest.name, (suite, test) -> 461 | test 'args', (done) -> 462 | safeps.spawn cliTest.spawn.concat([cliTest.sourcePath]), (err,stdout,stderr,code) -> 463 | equal(err, null, "error to be empty") 464 | equal(stdout.toString(), cliTest.expectedData, "stdout to be as expected") 465 | equal(stderr?.toString() or null, null, "stderr to be empty") 466 | equal(code, 0, "exit code to be 0") 467 | done() 468 | 469 | test 'stdin', (done) -> 470 | safeps.spawn cliTest.spawn, {stdin:cliTest.sourceData}, (err,stdout,stderr,code) -> 471 | equal(err, null, "error to be empty") 472 | equal(stdout.toString(), cliTest.expectedData, "stdout to be as expected") 473 | equal(stderr?.toString() or null, null, "stderr to be empty") 474 | equal(code, 0, "exit code to be 0") 475 | done() 476 | 477 | suite 'json2cson options', (suite,test) -> 478 | cliTest = cliTests[0] 479 | sourceData = JSON.parse cliTest.sourceData 480 | 481 | test '--tabs', (done) -> 482 | safeps.spawn cliTest.spawn.concat([cliTest.sourcePath, '--tabs']), (err,stdout,stderr,code) -> 483 | expected = CSON.createCSONString(sourceData, {indent:'\t'}) 484 | equal(err, null, "error to be empty") 485 | equal(stdout.toString(), expected, "stdout to be as expected") 486 | equal(stderr?.toString() or null, null, "stderr to be empty") 487 | equal(code, 0, "exit code to be 0") 488 | done() 489 | 490 | test '--2spaces', (done) -> 491 | safeps.spawn cliTest.spawn.concat([cliTest.sourcePath, '--2spaces']), (err,stdout,stderr,code) -> 492 | expected = CSON.createCSONString(sourceData, {indent:' '}) 493 | equal(err, null, "error to be empty") 494 | equal(stdout.toString(), expected, "stdout to be as expected") 495 | equal(stderr?.toString() or null, null, "stderr to be empty") 496 | equal(code, 0, "exit code to be 0") 497 | done() 498 | 499 | test '--4spaces', (done) -> 500 | safeps.spawn cliTest.spawn.concat([cliTest.sourcePath, '--4spaces']), (err,stdout,stderr,code) -> 501 | expected = CSON.createCSONString(sourceData, {indent:' '}) 502 | equal(err, null, "error to be empty") 503 | equal(stdout.toString(), expected, "stdout to be as expected") 504 | equal(stderr?.toString() or null, null, "stderr to be empty") 505 | equal(code, 0, "exit code to be 0") 506 | done() 507 | -------------------------------------------------------------------------------- /test-fixtures/api/cs-parse.coffee: -------------------------------------------------------------------------------- 1 | "#{5}" * 5 -------------------------------------------------------------------------------- /test-fixtures/api/cs-require.coffee: -------------------------------------------------------------------------------- 1 | module.exports = "#{5}" * 5 -------------------------------------------------------------------------------- /test-fixtures/api/cson-parse.cson: -------------------------------------------------------------------------------- 1 | a:b:1 -------------------------------------------------------------------------------- /test-fixtures/api/js-parse.js: -------------------------------------------------------------------------------- 1 | 5*5 -------------------------------------------------------------------------------- /test-fixtures/api/js-require.js: -------------------------------------------------------------------------------- 1 | module.exports = 5*5 -------------------------------------------------------------------------------- /test-fixtures/api/json-parse.json: -------------------------------------------------------------------------------- 1 | { "a": { "b": 1 } } -------------------------------------------------------------------------------- /test-fixtures/out-expected/1.cson: -------------------------------------------------------------------------------- 1 | abc: [ 2 | 'a' 3 | 'b' 4 | 'c' 5 | ] 6 | a: 7 | b: 'c' -------------------------------------------------------------------------------- /test-fixtures/out-expected/1.json: -------------------------------------------------------------------------------- 1 | { 2 | "abc": [ 3 | "a", 4 | "b", 5 | "c" 6 | ], 7 | "a": { 8 | "b": "c" 9 | } 10 | } -------------------------------------------------------------------------------- /test-fixtures/out-expected/2.cson: -------------------------------------------------------------------------------- 1 | greatDocumentaries: [ 2 | 'earthlings.com' 3 | 'forksoverknives.com' 4 | 'cowspiracy.com' 5 | ] 6 | importantFacts: 7 | emissions: ''' 8 | Livestock and their byproducts account for at least 32,000 million tons of carbon dioxide (CO2) per year, or 51% of all worldwide greenhouse gas emissions. 9 | Goodland, R Anhang, J. “Livestock and Climate Change: What if the key actors in climate change were pigs, chickens and cows?” 10 | WorldWatch, November/December 2009. Worldwatch Institute, Washington, DC, USA. Pp. 10–19. 11 | http://www.worldwatch.org/node/6294 12 | ''' 13 | landuse: ''' 14 | Livestock covers 45% of the earth’s total land. 15 | Thornton, Phillip, Mario Herrero, and Polly Ericksen. “Livestock and Climate Change.” Livestock Exchange, no. 3 (2011). 16 | https://cgspace.cgiar.org/bitstream/handle/10568/10601/IssueBrief3.pdf 17 | ''' 18 | burger: ''' 19 | One hamburger requires 660 gallons of water to produce – the equivalent of 2 months’ worth of showers. 20 | Catanese, Christina. “Virtual Water, Real Impacts.” Greenversations: Official Blog of the U.S. EPA. 2012. 21 | http://blog.epa.gov/healthywaters/2012/03/virtual-water-real-impacts-world-water-day-2012/ 22 | “50 Ways to Save Your River.” Friends of the River. 23 | http://www.friendsoftheriver.org/site/PageServer?pagename=50ways 24 | ''' 25 | milk: ''' 26 | 1,000 gallons of water are required to produce 1 gallon of milk. 27 | “Water trivia facts.” United States Environmental Protection Agency. 28 | http://water.epa.gov/learn/kids/drinkingwater/water_trivia_facts.cfm#_edn11 29 | ''' 30 | more: 'http://cowspiracy.com/facts' -------------------------------------------------------------------------------- /test-fixtures/out-expected/2.json: -------------------------------------------------------------------------------- 1 | { 2 | "greatDocumentaries": [ 3 | "earthlings.com", 4 | "forksoverknives.com", 5 | "cowspiracy.com" 6 | ], 7 | "importantFacts": { 8 | "emissions": "Livestock and their byproducts account for at least 32,000 million tons of carbon dioxide (CO2) per year, or 51% of all worldwide greenhouse gas emissions.\nGoodland, R Anhang, J. “Livestock and Climate Change: What if the key actors in climate change were pigs, chickens and cows?”\nWorldWatch, November/December 2009. Worldwatch Institute, Washington, DC, USA. Pp. 10–19.\nhttp://www.worldwatch.org/node/6294", 9 | "landuse": "Livestock covers 45% of the earth’s total land.\nThornton, Phillip, Mario Herrero, and Polly Ericksen. “Livestock and Climate Change.” Livestock Exchange, no. 3 (2011).\nhttps://cgspace.cgiar.org/bitstream/handle/10568/10601/IssueBrief3.pdf", 10 | "burger": "One hamburger requires 660 gallons of water to produce – the equivalent of 2 months’ worth of showers.\nCatanese, Christina. “Virtual Water, Real Impacts.” Greenversations: Official Blog of the U.S. EPA. 2012.\nhttp://blog.epa.gov/healthywaters/2012/03/virtual-water-real-impacts-world-water-day-2012/\n“50 Ways to Save Your River.” Friends of the River.\nhttp://www.friendsoftheriver.org/site/PageServer?pagename=50ways", 11 | "milk": "1,000 gallons of water are required to produce 1 gallon of milk.\n“Water trivia facts.” United States Environmental Protection Agency.\nhttp://water.epa.gov/learn/kids/drinkingwater/water_trivia_facts.cfm#_edn11", 12 | "more": "http://cowspiracy.com/facts" 13 | } 14 | } -------------------------------------------------------------------------------- /test-fixtures/out-expected/3.cson: -------------------------------------------------------------------------------- 1 | [ 2 | 1 3 | 2 4 | 3 5 | ] -------------------------------------------------------------------------------- /test-fixtures/out-expected/3.json: -------------------------------------------------------------------------------- 1 | [ 2 | 1, 3 | 2, 4 | 3 5 | ] -------------------------------------------------------------------------------- /test-fixtures/out-expected/4.cson: -------------------------------------------------------------------------------- 1 | abc: [ 2 | 'a' 3 | 'b' 4 | 'c' 5 | ] 6 | a: 7 | b: 'c' -------------------------------------------------------------------------------- /test-fixtures/out-expected/4.json: -------------------------------------------------------------------------------- 1 | { 2 | "abc": [ 3 | "a", 4 | "b", 5 | "c" 6 | ], 7 | "a": { 8 | "b": "c" 9 | } 10 | } -------------------------------------------------------------------------------- /test-fixtures/out-expected/5.cson: -------------------------------------------------------------------------------- 1 | filename: '5.coffee' 2 | abc: [ 3 | 'a' 4 | 'b' 5 | 'c' 6 | ] 7 | a: 8 | b: 'c' -------------------------------------------------------------------------------- /test-fixtures/out-expected/5.json: -------------------------------------------------------------------------------- 1 | { 2 | "filename": "5.coffee", 3 | "abc": [ 4 | "a", 5 | "b", 6 | "c" 7 | ], 8 | "a": { 9 | "b": "c" 10 | } 11 | } -------------------------------------------------------------------------------- /test-fixtures/out-expected/6.cson: -------------------------------------------------------------------------------- 1 | filename: '6.js' 2 | abc: [ 3 | 'a' 4 | 'b' 5 | 'c' 6 | ] 7 | a: 8 | b: 'c' -------------------------------------------------------------------------------- /test-fixtures/out-expected/6.json: -------------------------------------------------------------------------------- 1 | { 2 | "filename": "6.js", 3 | "abc": [ 4 | "a", 5 | "b", 6 | "c" 7 | ], 8 | "a": { 9 | "b": "c" 10 | } 11 | } -------------------------------------------------------------------------------- /test-fixtures/out-expected/7.cson: -------------------------------------------------------------------------------- 1 | a: 1 -------------------------------------------------------------------------------- /test-fixtures/out-expected/7.json: -------------------------------------------------------------------------------- 1 | { 2 | "a": 1 3 | } -------------------------------------------------------------------------------- /test-fixtures/out-expected/8.cson: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /test-fixtures/out-expected/8.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /test-fixtures/src/1.cson: -------------------------------------------------------------------------------- 1 | { 2 | # an array 3 | abc: [ 4 | 'a' 5 | 'b' 6 | 'c' 7 | ] 8 | 9 | # an object 10 | a: 11 | b: 'c' 12 | } -------------------------------------------------------------------------------- /test-fixtures/src/2.cson: -------------------------------------------------------------------------------- 1 | # Look Ma! Comments!!! 2 | 3 | # Look Ma! An Array with no commas! 4 | greatDocumentaries: [ 5 | 'earthlings.com' 6 | 'forksoverknives.com' 7 | 'cowspiracy.com' 8 | ] 9 | 10 | # Look Ma! An Object without braces! 11 | importantFacts: 12 | # Look Ma! Multi-Line Strings! Without Quote Escaping! 13 | emissions: ''' 14 | Livestock and their byproducts account for at least 32,000 million tons of carbon dioxide (CO2) per year, or 51% of all worldwide greenhouse gas emissions. 15 | Goodland, R Anhang, J. “Livestock and Climate Change: What if the key actors in climate change were pigs, chickens and cows?” 16 | WorldWatch, November/December 2009. Worldwatch Institute, Washington, DC, USA. Pp. 10–19. 17 | http://www.worldwatch.org/node/6294 18 | ''' 19 | 20 | landuse: ''' 21 | Livestock covers 45% of the earth’s total land. 22 | Thornton, Phillip, Mario Herrero, and Polly Ericksen. “Livestock and Climate Change.” Livestock Exchange, no. 3 (2011). 23 | https://cgspace.cgiar.org/bitstream/handle/10568/10601/IssueBrief3.pdf 24 | ''' 25 | 26 | burger: ''' 27 | One hamburger requires 660 gallons of water to produce – the equivalent of 2 months’ worth of showers. 28 | Catanese, Christina. “Virtual Water, Real Impacts.” Greenversations: Official Blog of the U.S. EPA. 2012. 29 | http://blog.epa.gov/healthywaters/2012/03/virtual-water-real-impacts-world-water-day-2012/ 30 | “50 Ways to Save Your River.” Friends of the River. 31 | http://www.friendsoftheriver.org/site/PageServer?pagename=50ways 32 | ''' 33 | 34 | milk: ''' 35 | 1,000 gallons of water are required to produce 1 gallon of milk. 36 | “Water trivia facts.” United States Environmental Protection Agency. 37 | http://water.epa.gov/learn/kids/drinkingwater/water_trivia_facts.cfm#_edn11 38 | ''' 39 | 40 | more: 'http://cowspiracy.com/facts' -------------------------------------------------------------------------------- /test-fixtures/src/3.cson: -------------------------------------------------------------------------------- 1 | # comment 2 | [1,2,3] 3 | # comment -------------------------------------------------------------------------------- /test-fixtures/src/4.json: -------------------------------------------------------------------------------- 1 | {"abc":["a","b","c"],"a":{"b":"c"}} -------------------------------------------------------------------------------- /test-fixtures/src/5.coffee: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | filename: require('path').basename(__filename) 3 | abc: [ "a", "b", "c" ] 4 | a: 5 | b: "c" 6 | } -------------------------------------------------------------------------------- /test-fixtures/src/6.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "filename": require('path').basename(__filename), 3 | "abc": ["a","b","c"], 4 | "a": { 5 | "b": "c" 6 | } 7 | }; -------------------------------------------------------------------------------- /test-fixtures/src/7.coffee: -------------------------------------------------------------------------------- 1 | if require? 2 | damages = [require('coffeescript'), require('cson-parser')] 3 | for damage in damages 4 | for own key,value of damage 5 | damage[key] = -> 'sucker' 6 | {a:1} -------------------------------------------------------------------------------- /test-fixtures/src/8.cson: -------------------------------------------------------------------------------- 1 | {} --------------------------------------------------------------------------------