Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6663145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:28:00+00:00 2026-05-26T02:28:00+00:00

When I open console of Chrome 14 and type… require (or require() , if

  • 0

When I open console of Chrome 14 and type…

require (or require(), if that matters)

I get: ReferenceError.

This means that JavaScript doesn’t have that function by default, right? At least on web browsers.

Why I’m talking about that?
I needed Markdown parser for JavaScript.

What to do?
I, as usually, opened GitHub and searched for it. The first results that matched my needs was this and this.

Usually (I’m not that good with JavaScript) I include script I want to use before my code using <script /> tag and then… well – use it. But this time I don’t get what’s happening… 🙁

Usage for #1 script:

var input = "# Heading\n\nParagraph";
var output = require( "markdown" ).toHTML( input );
print( output );

Usage for #2 script:

var marked = require('marked');
console.log(marked('i am using __markdown__.'));

Where does that require() came from? Thanks in an advice! 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:28:01+00:00Added an answer on May 26, 2026 at 2:28 am

    It’s a way to include node.js packages. Luckily, the first package you linked to, markdown-js, is very smart. It checks whether it is included as a node package, and if not, will set the markdown object to window.markdown. So all you have to do is include this file in a <script> tag and you should be able to use the markdown object from the global scope.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If you open this JSFiddle , you should see in Firebug/Chrome Dev Tools that
Open up a Rails console and enter this: 2.weeks.ago.between? 2.weeks.ago, 1.week.ago Did it give
Jquery works fine. Everything is functional. If I open up console and type :
Chrome does not appear to give any indication that a page has JavaScript errors,
I have a user script (for chrome and FF) that adds significant functionality to
I am trying to run this in Chrome/Firefox Console but not having any luck.
I've been trying to make a JavaScript function for a Google Chrome web-application that
I was writing user script for Google Chrome that would automatically open a specific
In IE 9, if I type this in the console: [1, 4, 2, 3].sort(function
I have this function: function exportdata(ID) { $.ajax({ type: POST, url: export.ashx?ID= + ID,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.