New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tocs

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tocs

print text to C-string

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

Install

npm install -g tocs

tocs is a command-tools, which type text-file to c-string. for example, if you have a file with content like:

// a.cpp
#include <cstdio>
using namespace std;

int main() {
    int T_T, A, B;
    scanf("%d", &T_T);
    for(int kase=1; kase <= T_T; ++kase) {
        scanf("%d%d", &A, &B);
        printf("%d\n", A+B);
    }
    return 0;
}

and if you want post this in a json-format with tool like postman, it will be really annoy for the quotes.

and now, you could use tocs a.cpp --copy without any pain to get its something like:

"#include <cstdio>\r\nusing namespace std;\r\n\r\nint main() {\r\n    int T_T, A, B;\r\n    scanf(\"%d\", &T_T);\r\n    for(int kase=1; kase <= T_T; ++kase) {\r\n        scanf(\"%d%d\", &A, &B);\r\n        printf(\"%d\\n\", A+B);\r\n    }\r\n    return 0;\r\n}\r\n"

Usage

tocs <filename> [options]

options

  • -c, --copy: copy the result to your system-clipboard. Default value is false.
  • -C, --charset <charset>: specified file's encoding. Default value is utf-8.

Keywords

FAQs

Package last updated on 22 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc