{"id":16720844,"url":"https://github.com/rochejul/karma-read-json5","last_synced_at":"2026-05-04T15:37:12.220Z","repository":{"id":57288516,"uuid":"97119631","full_name":"rochejul/karma-read-json5","owner":"rochejul","description":"Karma plugin to load JSON (and use if possible JSON5)","archived":false,"fork":false,"pushed_at":"2017-12-07T19:40:55.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-23T20:52:45.583Z","etag":null,"topics":["json","json5","karma","karma-plugin","nodejs","npm"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rochejul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-13T12:21:20.000Z","updated_at":"2017-07-13T12:22:42.000Z","dependencies_parsed_at":"2022-09-19T16:23:55.563Z","dependency_job_id":null,"html_url":"https://github.com/rochejul/karma-read-json5","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rochejul%2Fkarma-read-json5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rochejul%2Fkarma-read-json5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rochejul%2Fkarma-read-json5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rochejul%2Fkarma-read-json5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rochejul","download_url":"https://codeload.github.com/rochejul/karma-read-json5/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rochejul%2Fkarma-read-json5/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259265830,"owners_count":22831265,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json","json5","karma","karma-plugin","nodejs","npm"],"created_at":"2024-10-12T22:26:55.357Z","updated_at":"2025-10-27T05:02:39.946Z","avatar_url":"https://github.com/rochejul.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# karma-read-json5\n\n[![devDependency Status](https://david-dm.org/rochejul/karma-read-json5/dev-status.svg)](https://david-dm.org/rochejul/karma-read-json5#info=devDependencies)\n\n[![Known Vulnerabilities](https://snyk.io/test/github/rochejul/karma-read-json5/badge.svg)](https://snyk.io/test/github/rochejul/karma-read-json5)\n\n[![NPM](https://nodei.co/npm/karma-read-json5.png?downloads=true\u0026downloadRank=true)](https://nodei.co/npm/karma-read-json5/)\n[![NPM](https://nodei.co/npm-dl/karma-read-json5.png?\u0026months=6\u0026height=3)](https://nodei.co/npm/karma-read-json5/)\n\n\nKarma plugin to load JSON (and use if possible JSON5)\n\n## To install it\n\nSimply do:\n\n````\nnpm install --save-dev --save-exact karma-read-json5\n````\n\n## Karma.conf.js example\n\n````javascript\n// Karma configuration\n\nmodule.exports = function (config) {\n    config.set({\n\n        // base path that will be used to resolve all patterns (eg. files, exclude)\n        basePath: '',\n\n\n        // frameworks to use\n        // available frameworks: https://npmjs.org/browse/keyword/karma-adapter\n        frameworks: ['jasmine', 'readJSON'],\n\n\n        // list of files / patterns to load in the browser\n        files: [\n            { 'pattern': 'test/**/*.json', 'included': false, 'served': true, 'watched': false },\n            'test/**/*Spec.js'\n        ],\n\n\n        // list of files to exclude\n        exclude: [],\n\n\n        // preprocess matching files before serving them to the browser\n        // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor\n        preprocessors: {},\n\n\n        // test results reporter to use\n        // possible values: 'dots', 'progress'\n        // available reporters: https://npmjs.org/browse/keyword/karma-reporter\n        reporters: ['progress'],\n\n\n        // web server port\n        port: 9876,\n\n\n        // enable / disable colors in the output (reporters and logs)\n        colors: true,\n\n\n        // level of logging\n        // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG\n        logLevel: config.LOG_DEBUG,\n\n\n        // enable / disable watching file and executing tests whenever any file changes\n        autoWatch: false,\n\n\n        // start these browsers\n        // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher\n        browsers: ['PhantomJS'],\n\n        // Which plugins to enable\n        plugins: [\n            'karma-jasmine',\n            'karma-phantomjs-launcher',\n            'karma-read-json5'\n        ],\n\n        // Continuous Integration mode\n        // if true, Karma captures browsers, runs the tests and exits\n        singleRun: true,\n\n        // Concurrency level\n        // how many browser should be started simultaneous\n        concurrency: Infinity,\n        \n        client: {\n            readJSON: {\n                cached: true // Default false\n            }\n        }\n    })\n};\n\n````\n\n## Test example\n\n````javascript\n'use strict';\n\ndescribe('Sample - ', function () {\n    it('simple', function () {\n        expect(true).toBe(true);\n    });\n\n    it('with simple json', function () {\n        expect(readJSON('test/mock/normal.json')).toEqual({\n            \"array\": [\n                1,\n                2,\n                3\n            ],\n            \"boolean\": true,\n            \"null\": null,\n            \"number\": 123,\n            \"object\": {\n                \"a\": \"b\",\n                \"c\": \"d\",\n                \"e\": \"f\"\n            },\n            \"string\": \"Hello World\"\n        });\n    });\n\n    it('with extended json', function () {\n        expect(readJSON('test/mock/extended.json')).toEqual({\n                \"array\": [\n                    1,\n                    2,\n                    3\n                ],\n                \"boolean\": true,\n                \"null\": null,\n                \"Infinity\": Infinity,\n                \"number\": 123,\n                \"object\": {\n                    \"a\": \"b\",\n                    \"c\": \"d\",\n                    \"e\": \"f\"\n                },\n                \"string\": \"Hello World\"\n            }\n        );\n    });\n});\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frochejul%2Fkarma-read-json5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frochejul%2Fkarma-read-json5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frochejul%2Fkarma-read-json5/lists"}