This paper describes the design principles behind jsRealB, a surface realizer written in JavaScript for English or French sentences from a specification inspired by the constituent syntax formalism. It can be used either within a web page or as a node .js module. We show that the seemingly simple process of text realization involves many interesting implementation challenges in order to take into account the specifics of each language. jsRealB has a large coverage of English and French and has been used to develop realistic data-to-text applications and to reproduce existing literary texts and sentences with Universal Dependency annotations. Its source code and that of its applications are available on GitHub.