This is a Next.js project bootstrapped with create-next-app.

Word Wrap with Next JS

First, run the development server:

npm run dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying pages/index.js. The page auto-updates as you edit the file.

Word Wrap Description

Word Wrap Function - The function returns the string, but with line breaks inserted at just the right places to make sure that no line is longer than the column number. You try to break lines at word boundaries. Like a word processor, break the line by replacing the last space in a line with a newline.

On started application from main page click on "Sticker Test Page" link or go to "http://localhost:3000/sticker" URL manually.

You can find source code for the page in ./pages/sticker.js file. Correspondent test that might be useful to have are bootstrapped and available in __tests__/wordwrap.test.js file.