Deprecated: Return type of Dotenv\Environment\AbstractVariables::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/wb4wp-wordpress-plugin-bluehost-production/vendor/vlucas/phpdotenv/src/Environment/AbstractVariables.php on line 162

Deprecated: Return type of Dotenv\Environment\AbstractVariables::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/wb4wp-wordpress-plugin-bluehost-production/vendor/vlucas/phpdotenv/src/Environment/AbstractVariables.php on line 170

Deprecated: Return type of Dotenv\Environment\AbstractVariables::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/wb4wp-wordpress-plugin-bluehost-production/vendor/vlucas/phpdotenv/src/Environment/AbstractVariables.php on line 178

Deprecated: Return type of Dotenv\Environment\AbstractVariables::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/wb4wp-wordpress-plugin-bluehost-production/vendor/vlucas/phpdotenv/src/Environment/AbstractVariables.php on line 186

Deprecated: Return type of PhpOption\Some::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/wb4wp-wordpress-plugin-bluehost-production/vendor/phpoption/phpoption/src/PhpOption/Some.php on line 152

Deprecated: Return type of PhpOption\None::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/wb4wp-wordpress-plugin-bluehost-production/vendor/phpoption/phpoption/src/PhpOption/None.php on line 118

Deprecated: Return type of Requests_Cookie_Jar::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home3/realpyth/public_html/realjavascriptproject/wp-includes/Requests/Cookie/Jar.php on line 63

Deprecated: Return type of Requests_Cookie_Jar::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home3/realpyth/public_html/realjavascriptproject/wp-includes/Requests/Cookie/Jar.php on line 73

Deprecated: Return type of Requests_Cookie_Jar::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home3/realpyth/public_html/realjavascriptproject/wp-includes/Requests/Cookie/Jar.php on line 89

Deprecated: Return type of Requests_Cookie_Jar::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home3/realpyth/public_html/realjavascriptproject/wp-includes/Requests/Cookie/Jar.php on line 102

Deprecated: Return type of Requests_Cookie_Jar::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home3/realpyth/public_html/realjavascriptproject/wp-includes/Requests/Cookie/Jar.php on line 111

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home3/realpyth/public_html/realjavascriptproject/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 40

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home3/realpyth/public_html/realjavascriptproject/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 51

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home3/realpyth/public_html/realjavascriptproject/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 68

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home3/realpyth/public_html/realjavascriptproject/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 82

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home3/realpyth/public_html/realjavascriptproject/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 91

Deprecated: Creation of dynamic property OMAPI::$blocks is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/optinmonster/optin-monster-wp-api.php on line 440

Deprecated: Creation of dynamic property OMAPI::$revenue is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/optinmonster/optin-monster-wp-api.php on line 444

Deprecated: Creation of dynamic property OMAPI_WPForms::$save is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/optinmonster/OMAPI/WPForms.php on line 42
Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$post_id is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$title is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$description is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$keywords is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$keyphrases is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$page_analysis is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$canonical_url is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_title is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_description is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_object_type is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_image_type is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_image_url is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_image_width is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_image_height is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_image_custom_url is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_image_custom_fields is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_video is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_custom_url is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_article_section is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_article_tags is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$twitter_use_og is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$twitter_card is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$twitter_image_type is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$twitter_image_url is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$twitter_image_custom_url is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$twitter_image_custom_fields is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$twitter_title is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$twitter_description is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$seo_score is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$schema is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$schema_type is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$schema_type_options is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$pillar_content is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$robots_default is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$robots_noindex is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$robots_noarchive is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$robots_nosnippet is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$robots_nofollow is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$robots_noimageindex is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$robots_noodp is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$robots_notranslate is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$robots_max_snippet is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$robots_max_videopreview is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$robots_max_imagepreview is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$images is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$image_scan_date is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$priority is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$frequency is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$videos is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$video_thumbnail is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$video_scan_date is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$local_seo is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$limit_modified_date is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$options is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$post_id is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$title is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$description is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$keywords is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$keyphrases is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$page_analysis is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$canonical_url is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_title is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_description is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_object_type is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_image_type is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_image_url is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_image_width is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_image_height is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_image_custom_url is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_image_custom_fields is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_video is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_custom_url is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_article_section is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$og_article_tags is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$twitter_use_og is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$twitter_card is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$twitter_image_type is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$twitter_image_url is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$twitter_image_custom_url is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$twitter_image_custom_fields is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$twitter_title is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$twitter_description is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$seo_score is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$schema is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$schema_type is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$schema_type_options is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$pillar_content is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$robots_default is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$robots_noindex is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$robots_noarchive is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$robots_nosnippet is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$robots_nofollow is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$robots_noimageindex is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$robots_noodp is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$robots_notranslate is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$robots_max_snippet is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$robots_max_videopreview is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$robots_max_imagepreview is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$images is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$image_scan_date is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$priority is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$frequency is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$videos is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$video_thumbnail is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$video_scan_date is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$local_seo is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$limit_modified_date is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$options is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$created is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176

Deprecated: Creation of dynamic property AIOSEO\Plugin\Common\Models\Post::$updated is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-content/plugins/all-in-one-seo-pack/app/Common/Models/Model.php on line 176
dir="ltr" lang="en-US" prefix="og: https://ogp.me/ns#" > How to read and write files in JavaScript
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /home3/realpyth/public_html/realjavascriptproject/wp-includes/formatting.php on line 5420
green trees near mountain

Reading from a file is the process whereby we feed input to a computer program with different types of data contained on the file while writing to a file is the process of outputting contents of a computer program to a file.

The data being operated on by these programs can be of varying types and formats such as text, JSON, XML, and others.

When developing applications we occasionally come across requirements that require us to write or read data from files. For example, you might have a set of numeric values that you want to do a computation on them, and entering these values manually might lead to duplicates and errors in the input.

The most effective and efficient way to solve this problem is to create a program that reads the sets of values from a file, executes the computation, and outputs the results to another file.

In this tutorial, we will learn the different ways that we can leverage to read and write data into a file using JavaScript.

A Common bad practice while using client-side JavaScript

It is considered a bad practice to access the file system of your computer while using client-side JavaScript and very few browsers support this functionality.

This functionality is prevented due to security issues. If any website could have the capability to access the file system of a user’s machine, it could lead to a lot of data theft, hacking, and privacy issues.

Internet Explorer might be dead, however you might find the below useful

Internet explorer has an API named ActiveXObject that we can use to get a FileSystemObject to read and write on files. We are going to see this functionality in action in the next section.

There are other alternatives that we can use to realize this functionality such as: using FileReader to read from files and using server-side libraries with runtime environments such as node.

Writing to files in internet explorer using an ActiveXObject.

The ActiveXObject API is only available in internet explorer and is executed using the internet explorer console.

To open the internet explorer console, right-click on the browser and select the option labeled view source, alternatively you can press the F12 button on your computer keyboard.

Select the option labeled Console on the window that opens to open the editor where we will write our code.

Copy and paste the following code into the console.

function writeToFile(path, data){
var writeSystemObject = new ActiveXObject("Scripting.FileSystemObject");
var writeStream = writeSystemObject.CreateTextFile(path,true);
writeStream.Write(data);
writeStream.close();
}
writeToFile("C:\\theFile.txt", "This text was written using a TextStream");
view raw index.js hosted with ❤ by GitHub

In the above code, we have created the writeToFile() method that accepts two parameters path and data. The path represents the location where our file will be created and the data represents the contents to be written in the file.

The ActiveXObject() method returns an object that allows us to access the file system by passing the argument Scripting.FileSystemObject.

Call the CreateTextFile() method from the returned object and pass our path to this method and a second boolean parameter containing the value of true.

The true value indicates that the existing file can be overwritten and you should change it to false if otherwise.

The CreateTextFile() method returns a TextStream that allows us to write to the file. Call the Write() method on the returned TextStrem object and pass our data to this method to write it to the file.

Finally, call your custom function writeToFile() and pass the concrete details regarding the path and the data.

To execute the code, press the run button located on the bottom right section of the console window as shown in the following image.

The following image verifies that a file named theFile.txt was created under local disk C and a text containing the value This text was written using a TextStream written into it.

Reading from files in internet explorer using a ActiveXObject.

This example has the same steps as the previous one with the exception that it has its methods to read from a file.

Copy and paste the following code into the internet explorer console.

function readFromFile(path, data, ForReading){
//create and write to the previous file
var writeSystemObject = new ActiveXObject("Scripting.FileSystemObject");
var writeStream = writeSystemObject.CreateTextFile(path,true);
writeStream.Write(data);
writeStream.close();
//Read from the file
var readSystemObject = new ActiveXObject("Scripting.FileSystemObject");
var readStream = readSystemObject.OpenTextFile(path, ForReading);
var text = readStream.ReadLine();
console.log("Text read from file: "+text)
readStream.close();
}
readFromFile("C:\\theFile.txt", "This text was written using a TextStream",1);
view raw index.js hosted with ❤ by GitHub

In the above code, we have created a method named readFromFile() that accepts three parameters, pathdata, and ForReading.

The ForReading method is used to indicate that the file mode will only allow the file to be read. Other modes can be passed such as ForWriting and ForAppending. These modes are represented with the values 12, and 8 respectively.

The code starts with creating and writing a file as we did in the previous example and the next step reads from the created file.

Call the OpenTextFile() from the object returned by ActiveXObject() and pass the path and the ForReading parameters in the method.

The OpenTextFile() method returns a TextStream that allows us to read from the file. Call ReadLine() from from the TextStream object to read from the file. The ReadLine() method will return the contents of the file as a string.

To verify that our file was read, log the contents of the string to the console as shown in the following image.

Press the run button to execute the code and note that the text that we wrote to the file is the same as the one we have logged to the console.

Reading from files using FileReader API

The FileReader API is another we can utilize to read from files but note that it does not read files from the file system but reads files selected using the HTML input tag.

Go to visual studio code and create a file named index.html. copy and paste the following code.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script>
function readFromFile() {
const display = document.querySelector('.display');
const [file] = document.querySelector('input[type=file]').files;
const reader = new FileReader();
reader.addEventListener("load", () => {
// this will then display a text file
display.innerText = reader.result;
}, false);
if (file) {
reader.readAsText(file);
}
}
</script>
</head>
<body>
<input type="file" onchange="readFromFile()"><br>
<p class="display"></p>
</body>
</html>
view raw index.html hosted with ❤ by GitHub

In the above code, we have created an HTML file that contains an input of type file and one paragraph.

Inside the head section, we have added the JavaScript code with will handle the functionality of reading the file that we select.

To retrieve the selected file, we use the querySelector() method and pass the type of input as a parameter to this method.

The readAsText() method reads the contents of the file and returns the result as a string. To display this string to the browser we use the querySelector() and pass class as the parameter to this method to retrieve the paragraph and assign it the result.

Having gained access to the paragraph, we set its innerText value to the result returned by the readAsText() method once the file has been loaded as indicated by the addEventListener() method.

Create a file named file-reader.txt and add the text Reading using a FileWriter inside the file. Open the index.html file in any browser and press the choose file button to select the file-reader.txt file.

The contents we added in the file-reader.txt are read by the FileReader and displayed by the paragraph as shown in the following image.

Reading from files using server-side modules

This is another way that we can use to read files using JavaScript by leveraging the node modules. In this example, we will use a file system module of the node module to read from a file on our file system.

Go to visual studio code and create a file named content.txt. Copy and paste the following text into the file.

File read using a server side module

Create another file named server.js and paste the following code into the file.

const fileSystem = require('fs');
fileSystem.readFile('content.txt','utf8',(err,data) =>{
if(err){
console.error(err);
return;
}
console.log(data);
} );

view raw index.js hosted with ❤ by GitHub

We use the require() method to retrieve the file system object by passing fs as a parameter of the method.

Call the readFile() method from the returned object and pass the file to be read, the encoding, and a callback as the parameters of the method.

The callback contains an error that may occur when reading the file and the data read from the file if there is no error.

Inside the callback function, we first check if there is an error and log it to the console. otherwise, we log the contents read from the file to the console.

Use the following command to execute the code and note that the node runtime environment must be installed on your computer before executing the code.

~/Documents/project$ node server.js

output:

File read using a server side module

Writing to files using a server-side module

This is the final approach that we are going to cover in this article. This method is the same as the above but with a few differences.

We will use the server.js file and content.txt files that we have created in the previous example. Clear the contents of the JavaScript file and paste the following code into the file.

const fileSystem = require('fs');
const data = "File written using a server side module";
fileSystem.writeFile('content.txt',data , err =>{
if(err){
console.error(err);
return;
}
} );
view raw index.js hosted with ❤ by GitHub

Call the writeFile() method from the file system object returned by the require() method and pass the file name, the data to be written to the file, and a callback as the parameters of the method.

We have created a string to hold the data to be written to the file. The callback function of the writeFile() method has only one parameter that contains an error that might occur when we try to write to the file.

Use the same command we used in the previous example to execute this code. The string we created in the content.txt file is overwritten with a new string that we have defined in the writeFile() method.

If you open the content.txt file, you will find that it has been overwritten with the following text.

File written using a server side module

Conclusion

In this tutorial, we have learned how to read and write from files in JavaScript by using the ActiveXObject available in internet explorer, using FileReader API to read from files, and finally using server-side libraries with node to read and write from files. The main point to note in this tutorial is that browsers should not access the user’s file system as it is considered a bad practice and also leads to security issues


Read more articles at RealJavaScriptProject

You can support me by buying me a coffee on Kofi ☕️🙏🏼