7.0.1 • Published 3 years ago

load-json-file v7.0.1

Weekly downloads
28,898,807
License
MIT
Repository
github
Last release
3 years ago

load-json-file

Read and parse a JSON file

It also strips UTF-8 BOM.

Install

$ npm install load-json-file

Usage

import {loadJsonFile} from 'load-json-file';

console.log(await loadJsonFile('foo.json'));
//=> {foo: true}

API

loadJsonFile(filePath, options?)

Returns a Promise<unknown> with the parsed JSON.

loadJsonFileSync(filepath, options?)

Returns the parsed JSON.

options

Type: object

beforeParse

Type: Function

Applies a function to the JSON string before parsing.

reviver

Type: Function

Prescribes how the value originally produced by parsing is transformed, before being returned. See the JSON.parse docs for more.

load-json-file for enterprise

Available as part of the Tidelift Subscription.

The maintainers of load-json-file and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.

Related

lerna@lerna/create@lerna/package@lerna/projectpkg-conf@megasaur/project@vastly/wave-cli@essent/lernaarchetype-libraryeasy-select-rnchinjowwchinjowreact-native-bluetooth2killi8n-react-native-fast-imagepipihomern-send-sms@icanpm/api-master@arisageha/react-lazyload@arisageha/react-lazyload-fixenigma-p2p@almeidaa/ms@yogsothothtc/metrics-libraryairscanairscan-examplebb-chatreact-native-esc-pos-sahaab@borisovart/atol-kkt-module@frxf/frxf@mxttwoods/readme-generator@mxttwoods/readme-clideneme323112@mxttwoods/readme@ntt_app/react-native-custom-notificationreact-native-covid-sdkgql_din_modreact-native-thanh-toast-librarymutasi-bca@jttechnic/interpreter@thanhnguyen14797/react-native-thanh-toast-library@cderek/docs-generator-clicthpb-plugin-social@olivervorasai/sliderpanqibaoreact-native-printer-brothersrn-pdf-reader-offlinestrapuxreact-native-shekhar-bridge-testcogoportutilsukor-remaster@oiti/documentoscopy-react-native@respondea/cordova-plugin-v-inappbrowser@mink-opn/build-tokensquoc-testreact-native-slider-kfunblock-block-save-variablesbabel7-upgradecreate-maca-project@infinitebrahmanuniverse/nolb-loa@saaspe/componentsmoke-images-tinifyopea-bootstraapluminos-ui-core@everything-registry/sub-chunk-2091jawwy-sdkjawwy_gamification_releasereact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgp149-table@rabailriaz/hisaab-web-portalreact-native-jawwy_sampleeasyplayer-myearpodearpodsearpodssselvyelm-check-updateselectron-preferenceselectron-releaseeslint-plugin-monorepoeslint-plugin-patternplate3.0.0@brucearmstrong/sass-librarylayui-customjawwy_library_newjawy_library_v1gamification-jawwy-libraryframework_test_library_sixdee_new_jawwycollate-json-clitest_lib_module_aarconnex_ram00nezgit-labels-cligit-precommit-checksgit-repo-npm-bootster@monots/corequery-pattern-agegh-monoproject-cliquickcapture_react_nativequdratic-ui
7.0.1

3 years ago

7.0.0

3 years ago

6.2.0

5 years ago

6.1.0

5 years ago

6.0.0

5 years ago

5.3.0

5 years ago

5.2.0

5 years ago

5.1.0

6 years ago

5.0.0

6 years ago

4.0.0

6 years ago

3.0.0

7 years ago

2.0.0

8 years ago

1.1.0

8 years ago

1.0.1

9 years ago

1.0.0

9 years ago