GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - k14v/printf-tokenize: Javascript printf tokenize

BranchesTags
Open more actions menu

Latest commit

 

History

74 Commits
74 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
src
src
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.npmignore
.npmignore
 
 
.releaserc.json
.releaserc.json
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
README.md
README.md
 
 
commitlint.config.js
commitlint.config.js
 
 
eslint.config.mjs
eslint.config.mjs
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation

printf-tokenize

Javascript printf tokenize creates a array of tokens using the standard from cplusplus http://www.cplusplus.com/reference/cstdio/printf/ to parse flags.

const tokenize = require('@k14v/printf-tokenize')

tokenize('This is %s test with %d flags')

/*
[ { type: 'Literal', value: 'This is ', start: 0, end: 8, length: 8 },
  { type: 'Parameter',
    value: '%s',
    start: 8,
    end: 10,
    length: 2,
    kind: 'String',
    specifier: 's' },
  { type: 'Literal',
    value: ' test with ',
    start: 10,
    end: 21,
    length: 11 },
  { type: 'Parameter',
    value: '%d',
    start: 21,
    end: 23,
    length: 2,
    kind: 'Number',
    specifier: 'd',
    variant: 'Integer' },
  { type: 'Literal', value: ' flags', start: 23, end: 29, length: 6 } ]
*/

About

Javascript printf tokenize

Resources

Readme

Contributing

Contributing
Activity
Custom properties

Stars

0 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.