{"id":25427883,"url":"https://github.com/nostackapp/ns-flip","last_synced_at":"2025-08-20T15:44:02.790Z","repository":{"id":55424281,"uuid":"303406133","full_name":"NoStackApp/ns-flip","owner":"NoStackApp","description":"Creation and use of *replaceable\" templates from code samples.  A user can switch template versions and all of the changes to the code are maintained.","archived":false,"fork":false,"pushed_at":"2020-12-31T14:19:38.000Z","size":1273,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-05T18:52:36.854Z","etag":null,"topics":["automation","customize","generator","handlebars","handlebars-js","ns-flip","packages","template","template-engine","templates","updates","version-manager","versioning"],"latest_commit_sha":null,"homepage":"https://ns-flip.nostack.net/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NoStackApp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":"docs/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-12T13:47:33.000Z","updated_at":"2020-12-31T14:19:41.000Z","dependencies_parsed_at":"2022-08-15T00:00:55.674Z","dependency_job_id":null,"html_url":"https://github.com/NoStackApp/ns-flip","commit_stats":null,"previous_names":[],"tags_count":72,"template":false,"template_full_name":null,"purl":"pkg:github/NoStackApp/ns-flip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoStackApp%2Fns-flip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoStackApp%2Fns-flip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoStackApp%2Fns-flip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoStackApp%2Fns-flip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NoStackApp","download_url":"https://codeload.github.com/NoStackApp/ns-flip/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoStackApp%2Fns-flip/sbom","scorecard":{"id":102153,"data":{"date":"2025-08-11","repo":{"name":"github.com/NoStackApp/ns-flip","commit":"6924b9e0adfb8e2a84dc54930f6aac25a825bc21"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/12 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 24 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"31 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-8hfj-j24r-96c4","Warn: Project is vulnerable to: GHSA-wc69-rhjr-hc9g","Warn: Project is vulnerable to: GHSA-px4h-xg32-q955","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-pq67-2wwv-3xjx","Warn: Project is vulnerable to: GHSA-8cj5-5rvv-wf4v","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-15T10:21:58.075Z","repository_id":55424281,"created_at":"2025-08-15T10:21:58.075Z","updated_at":"2025-08-15T10:21:58.075Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271344463,"owners_count":24743472,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","customize","generator","handlebars","handlebars-js","ns-flip","packages","template","template-engine","templates","updates","version-manager","versioning"],"created_at":"2025-02-17T01:30:44.794Z","updated_at":"2025-08-20T15:44:02.736Z","avatar_url":"https://github.com/NoStackApp.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"ns-flip\n------------\n\nMake and use *updatable* project templates.  Regenerate code without losing custom changes. Framework agnostic.\n\n\u003ca href=\"https://spectrum.chat/ns-flip\"\u003e\n    \u003cimg alt=\"Join our new community on Spectrum\" src=\"https://withspectrum.github.io/badge/badge.svg\"\u003e\n  \u003c/a\u003e\n  \n  \n[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)\n[![Version](https://img.shields.io/npm/v/ns-flip.svg)](https://npmjs.org/package/ns-flip)\n[![Downloads/week](https://img.shields.io/npm/dw/ns-flip.svg)](https://npmjs.org/package/ns-flip)\n[![License](https://img.shields.io/npm/l/ns-flip.svg)](https://github.com/NoStackApp/ns-flip/blob/master/package.json)\n\n![](images/distributed-maintenance-2.x.png)\n\n\n\u003c!-- toc --\u003e\n* [Why](#why)\n* [What](#what)\n* [How](#how)\n* [Help](#help)\n* [Usage](#usage)\n* [Commands](#commands)\n\u003c!-- tocstop --\u003e\n\n# Why\nAfter you generate code with a template or tool, you make changes.  But then usually you can't regenerate the code without losing your changes.  So you can't apply an updated template or change to another one supporting the same inputs. Keeping your \"legacy code\" current becomes an expensive pain.  \n\n# What\nns-flip is a CLI to support creating and using project generators that can be exchanged as easily as WordPress themes. Here is a [sample](https://www.npmjs.com/package/easy-oclif-cli) with [1 minute video](https://www.youtube.com/watch?v=MAVN8hZpcqY).\n\nA \"template\" can generate any combination of three types of files:\n\n1. standard (appear in every generated code base, e.g. `App.jsx`)\n2. custom static (static, but must be custom specified for each code base, e.g. steps in an input stepper)\n3. custom dynamic (based on queries e.g. components showing query results).\n\nYou can create templates with locations designated for custom code within the generated files.  You can also name regions that can be replaced or removed in the generated code. Ns-flip stores the custom changes before regenerating and then restores them.\n\nSee some [standard use cases][2].\n\n# How\nA _template_ is a directory with requirements explained in the [documentation][1].  You can use it privately or distribute it.  \nYou will need a basic working knowledge of [Handlebars](https://handlebarsjs.com/guide/) and not much more.\n\n![ns-flip-commands](images/ns-flip-2.x-commands.png)\n\n1. Build a template from sample code by calling [`ns newtemplate`](#ns-newtemplate) with a sample code base.  \n2. Generate or regenerate code from the template : [`ns generate $CODE [-t $TEMPLATE`](#ns-generate-codedir).  All safe changes to $CODE are preserved.  There's a settings file for the code base that determines what is generated.\n3. Modify your requirements by running [`ns settings $CODE`](#ns-settings-codedir).  Just answer the prompts. \n4. Add custom code.  But periodically run  [`ns check $CODE`](#ns-check-codedir) to be sure you are doing it safely.  (Otherwise, some of your changes will not be preserved when `ns generate` is run in the future.)\n\n# Help\n\n* Read our [documentation][1]\n* Post questions on our [Community](https://spectrum.chat/ns-flip)\n*  [open issues](https://github.com/NoStackApp/ns-flip/issues/new)\n\n[![Getting Started with ns-flip 1.6 Templating](https://img.youtube.com/vi/whb6B2FA_Yo/maxresdefault.jpg)](https://youtu.be/whb6B2FA_Yo)\n\n# Usage\n\u003c!-- usage --\u003e\n```sh-session\n$ npm install -g ns-flip\n$ ns COMMAND\nrunning command...\n$ ns (-v|--version|version)\nns-flip/2.5.0 linux-x64 node-v14.9.0\n$ ns --help [COMMAND]\nUSAGE\n  $ ns COMMAND\n...\n```\n\u003c!-- usagestop --\u003e\n\n# Commands\n\u003c!-- commands --\u003e\n* [`ns check CODEDIR`](#ns-check-codedir)\n* [`ns contact [MESSAGE]`](#ns-contact-message)\n* [`ns filediffs TEMPLATEDIR`](#ns-filediffs-templatedir)\n* [`ns generate CODEDIR`](#ns-generate-codedir)\n* [`ns help [COMMAND]`](#ns-help-command)\n* [`ns newtemplate`](#ns-newtemplate)\n* [`ns settings CODEDIR`](#ns-settings-codedir)\n\n## `ns check CODEDIR`\n\nConfirms that your custom changes have been entered safely, allowing you to generate with an updated or replaced template, or with a changed 'ns.yml' file. Essentially, generates a new version of the code and then simply compares it against your current version.  If there are differences, then there is a problem with your code. For documentation about safe custom code changes, please see https://ns-flip.nostack.net//Safe-Custom-Code.\n\n```\nUSAGE\n  $ ns check CODEDIR\n\nARGUMENTS\n  CODEDIR  directory containing the code to check\n\nOPTIONS\n  -h, --help  show CLI help\n\nEXAMPLE\n  $ ns check ~/projects/myapp\n```\n\n_See code: [lib/commands/check.js](https://github.com/NoStackApp/ns-flip/blob/v2.5.0/lib/commands/check.js)_\n\n## `ns contact [MESSAGE]`\n\nsend feedback or request to ns-flip.  Optionally provide email and other fields.\n\n```\nUSAGE\n  $ ns contact [MESSAGE]\n\nARGUMENTS\n  MESSAGE  the message to send\n\nOPTIONS\n  -e, --email=email  email of sender\n  -h, --help         show CLI help\n\nEXAMPLES\n  $ ns contact \"how do I set up comment delimiters with escape chars?\" -e pauljones123@gmail.com\n  $ ns contact \"generate is breaking when I add handlers.\"\n```\n\n_See code: [lib/commands/contact.js](https://github.com/NoStackApp/ns-flip/blob/v2.5.0/lib/commands/contact.js)_\n\n## `ns filediffs TEMPLATEDIR`\n\ncompare the files in your sample target code and in the code being generated. In some cases makes suggestions.\n\n```\nUSAGE\n  $ ns filediffs TEMPLATEDIR\n\nARGUMENTS\n  TEMPLATEDIR  directory containing the template\n\nOPTIONS\n  -c, --codeDir=codeDir    code directory.  Will override the default\n  -h, --help               show CLI help\n  -s, --modelDir=modelDir  model directory.  Will override the default\n\nEXAMPLES\n  $ ns filediffs $TEMPLATE\n  $ ns filediffs $TEMPLATE -c $CODE -m $MODEL\n```\n\n_See code: [lib/commands/filediffs.js](https://github.com/NoStackApp/ns-flip/blob/v2.5.0/lib/commands/filediffs.js)_\n\n## `ns generate CODEDIR`\n\ngenerates code based on a template and an 'ns file'.  To set the template, you need the template flag.\n\n```\nUSAGE\n  $ ns generate CODEDIR\n\nARGUMENTS\n  CODEDIR  directory containing the code to check\n\nOPTIONS\n  -h, --help                     show CLI help\n\n  -n, --noSetup                  Do not update the startup routine (this is only relevant when the templateDir flag is\n                                 also used). Saves a lot of time for a template developer.\n\n  -t, --templateDir=templateDir  Template directory. Will generate from the template, and will override any prior\n                                 template or template version used.\n\nEXAMPLES\n  $ ns generate ~/ns/samples/out -t ~/ns/templates/basicTemplate\n  $ ns generate $CODE -t $TEMPLATE --noSetup\n  $ ns generate $CODE\n```\n\n_See code: [lib/commands/generate.js](https://github.com/NoStackApp/ns-flip/blob/v2.5.0/lib/commands/generate.js)_\n\n## `ns help [COMMAND]`\n\ndisplay help for ns\n\n```\nUSAGE\n  $ ns help [COMMAND]\n\nARGUMENTS\n  COMMAND  command to show help for\n\nOPTIONS\n  --all  see all commands in CLI\n```\n\n_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.0/src/commands/help.ts)_\n\n## `ns newtemplate`\n\ncreate new template.\n\n```\nUSAGE\n  $ ns newtemplate\n\nOPTIONS\n  -h, --help                     show CLI help\n  -m, --model=model              directory containing the model code base from which you want to template\n  -t, --templateDir=templateDir  directory for the template\n\nEXAMPLE\n  $ ns newtemplate -m $MODEL -t $TEMPLATE\n```\n\n_See code: [lib/commands/newtemplate.js](https://github.com/NoStackApp/ns-flip/blob/v2.5.0/lib/commands/newtemplate.js)_\n\n## `ns settings CODEDIR`\n\ncreate new template.\n\n```\nUSAGE\n  $ ns settings CODEDIR\n\nARGUMENTS\n  CODEDIR  directory containing the code\n\nOPTIONS\n  -h, --help  show CLI help\n\nEXAMPLE\n  $ ns settings $CODE\n```\n\n_See code: [lib/commands/settings.js](https://github.com/NoStackApp/ns-flip/blob/v2.5.0/lib/commands/settings.js)_\n\u003c!-- commandsstop --\u003e\n\n\n   [1]: https://ns-flip.nostack.net/\n   [2]: https://ns-flip.nostack.net/uses\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnostackapp%2Fns-flip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnostackapp%2Fns-flip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnostackapp%2Fns-flip/lists"}